Skip to content

Commit

Permalink
Log in one common location
Browse files Browse the repository at this point in the history
Reduces dependence on `InstallRequirement` being passed to
`_fetch_metadata`.
  • Loading branch information
chrahunt committed Aug 2, 2020
1 parent 6c4d4f3 commit 21db4f3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pip/_internal/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ def _fetch_metadata(preparer, req):
if use_lazy_wheel and remote_wheel and not preparer.require_hashes:
wheel = Wheel(link.filename)
name = canonicalize_name(wheel.name)
logger.info('Collecting %s', req.req or req)
# If HTTPRangeRequestUnsupported is raised, fallback silently.
with indent_log(), suppress(HTTPRangeRequestUnsupported):
logger.info(
Expand All @@ -484,12 +483,12 @@ def _fetch_metadata(preparer, req):
def prepare_linked_requirement(self, req, parallel_builds=False):
# type: (InstallRequirement, bool) -> Distribution
"""Prepare a requirement to be obtained from req.link."""
wheel_dist = self._fetch_metadata(req)
if wheel_dist is not None:
return wheel_dist
assert req.link
link = req.link
self._log_preparing_link(req)
wheel_dist = self._fetch_metadata(req)
if wheel_dist is not None:
return wheel_dist
if link.is_wheel and self.wheel_download_dir:
# Download wheels to a dedicated dir when doing `pip wheel`.
download_dir = self.wheel_download_dir
Expand Down

0 comments on commit 21db4f3

Please sign in to comment.