Skip to content

Commit 1a28d08

Browse files
committed
Commits to communicate
1 parent 328e4c0 commit 1a28d08

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/pip/_internal/operations/prepare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ def _get_linked_req_hashes(self, req):
449449
# showing the user what the hash should be.
450450
return req.hashes(trust_internet=False) or MissingHashes()
451451

452-
def prepare_linked_requirement(self, req, parallel_builds=False):
452+
def download_linked_requirement(self, req, parallel_builds=False):
453453
# type: (InstallRequirement, bool) -> AbstractDistribution
454454
"""Prepare a requirement to be obtained from req.link."""
455455
assert req.link

src/pip/_internal/resolution/legacy/resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def _get_abstract_dist_for(self, req):
337337

338338
# We eagerly populate the link, since that's our "legacy" behavior.
339339
self._populate_link(req)
340-
abstract_dist = self.preparer.prepare_linked_requirement(req)
340+
abstract_dist = self.preparer.download_linked_requirement(req)
341341

342342
# NOTE
343343
# The following portion is for determining if a certain package is

src/pip/_internal/resolution/resolvelib/candidates.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,6 @@ def _prepare_abstract_distribution(self):
199199

200200
def _prepare(self):
201201
# type: () -> None
202-
if self._dist is not None:
203-
return
204-
205202
try:
206203
abstract_dist = self._prepare_abstract_distribution()
207204
except HashError as e:
@@ -224,10 +221,19 @@ def _prepare(self):
224221
self._ireq, "version", self._dist.version,
225222
)
226223

224+
def _fetch_metadata(self):
225+
# logic for downloads
226+
if not partial_downloads:
227+
self._prepare()
228+
return
229+
230+
# populate self._dist with partial downloads
231+
227232
@property
228233
def dist(self):
229234
# type: () -> Distribution
230-
self._prepare()
235+
if self._dist is not None:
236+
self._fetch_metadata()
231237
return self._dist
232238

233239
def _get_requires_python_specifier(self):
@@ -295,7 +301,7 @@ def __init__(
295301

296302
def _prepare_abstract_distribution(self):
297303
# type: () -> AbstractDistribution
298-
return self._factory.preparer.prepare_linked_requirement(
304+
return self._factory.preparer.download_linked_requirement(
299305
self._ireq, parallel_builds=True,
300306
)
301307

0 commit comments

Comments
 (0)