summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2020-08-06 17:31:10 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2020-08-06 18:43:02 +0700
commit11f7994a6690fcce5a1fdaddc9e3c779255cb334 (patch)
tree55149383a962f40444129cdd7aecef7422674b61
parent487d00295ce0409ab59fd162e328654c6f93afc3 (diff)
downloadpip-11f7994a6690fcce5a1fdaddc9e3c779255cb334.tar.gz
Revise method fetching metadata using lazy wheels
* Rename it to fit the fact that it no longer handle fetching _not_ using lazy wheels * Use self as the first parameter * Unnest the checks with additional logs showing reason when lazy wheel is not used
-rw-r--r--src/pip/_internal/operations/prepare.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py
index 209a6069b..e9e534e32 100644
--- a/src/pip/_internal/operations/prepare.py
+++ b/src/pip/_internal/operations/prepare.py
@@ -9,7 +9,6 @@ import mimetypes
import os
import shutil
-from pip._vendor.contextlib2 import suppress
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.six import PY2
@@ -462,7 +461,7 @@ class RequirementPreparer(object):
# showing the user what the hash should be.
return req.hashes(trust_internet=False) or MissingHashes()
- def _fetch_metadata(preparer, link):
+ def _fetch_metadata_using_lazy_wheel(self, link):
# type: (Link) -> Optional[Distribution]
"""Fetch metadata using lazy wheel, if possible."""
if not self.use_lazy_wheel:
@@ -497,7 +496,8 @@ class RequirementPreparer(object):
assert req.link
link = req.link
self._log_preparing_link(req)
- wheel_dist = self._fetch_metadata(link)
+ with indent_log():
+ wheel_dist = self._fetch_metadata_using_lazy_wheel(link)
if wheel_dist is not None:
req.needs_more_preparation = True
return wheel_dist