Skip to content

Commit

Permalink
(joe) update news, turn finder into a public attribute of resolver cl…
Browse files Browse the repository at this point in the history
…ass, test lack_sem_open false directly
  • Loading branch information
jbylund committed Sep 21, 2021
1 parent 24f76da commit 3b5ac13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion news/10480.feature.rst
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Prepopulate find_all_candidates cache in parallel to reduce overhead when collecting packages to install.
Parallelize network requests when finding package candidates for installation.
11 changes: 3 additions & 8 deletions src/pip/_internal/resolution/resolvelib/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(
):
super().__init__()
assert upgrade_strategy in self._allowed_strategies

self.finder = finder
self.factory = Factory(
finder=finder,
preparer=preparer,
Expand Down Expand Up @@ -90,13 +90,8 @@ def resolve(
reporter,
)

if LACK_SEM_OPEN:
# if a working threading implementation unavailable do nothing
pass
else:
# otherwise greedily call/consume _finder.find_all_candidates in parallel
# in order to populate the lru cache such that future calls don't block on
# networking
if LACK_SEM_OPEN is False:

def _maybe_find_candidates(req: Requirement) -> None:
ident = provider.identify(req)
try:
Expand Down

0 comments on commit 3b5ac13

Please sign in to comment.