Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move prepare_pep517_metadata to generate_metadata #7239

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: Unpack from install_req eagerly
  • Loading branch information
pradyunsg committed Oct 19, 2019
commit e6875ec7cc52a010f668e9b9fa0a00d557bb1702
5 changes: 3 additions & 2 deletions src/pip/_internal/operations/generate_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,19 +135,20 @@ def _generate_metadata_legacy(install_req):
def _generate_metadata(install_req):
# type: (InstallRequirement) -> str
assert install_req.pep517_backend is not None
build_env = install_req.build_env
backend = install_req.pep517_backend

# NOTE: This needs to be refactored to stop using atexit
metadata_tmpdir = TempDirectory(kind="modern-metadata")
atexit.register(metadata_tmpdir.cleanup)

metadata_dir = metadata_tmpdir.path

with install_req.build_env:
with build_env:
# Note that Pep517HookCaller implements a fallback for
# prepare_metadata_for_build_wheel, so we don't have to
# consider the possibility that this hook doesn't exist.
runner = runner_with_spinner_message("Preparing wheel metadata")
backend = install_req.pep517_backend
with backend.subprocess_runner(runner):
distinfo_dir = backend.prepare_metadata_for_build_wheel(
metadata_dir
Expand Down