Skip to content

Commit

Permalink
Merge pull request #8974 from NoahGorny/fix-new-resolver-upgrades-whe…
Browse files Browse the repository at this point in the history
…n-not-needed-to
  • Loading branch information
pradyunsg authored Oct 10, 2020
2 parents 95dbf34 + 7e02958 commit 063f2ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions news/8963.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Correctly search for installed distributions in new resolver logic in order
to not miss packages (virtualenv packages from system-wide-packages for example)
10 changes: 8 additions & 2 deletions src/pip/_internal/resolution/resolvelib/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,15 @@ def __init__(
self._editable_candidate_cache = {} # type: Cache[EditableCandidate]

if not ignore_installed:
packages = get_installed_distributions(
local_only=False,
include_editables=True,
editables_only=False,
user_only=False,
paths=None,
)
self._installed_dists = {
canonicalize_name(dist.project_name): dist
for dist in get_installed_distributions()
canonicalize_name(p.key): p for p in packages
}
else:
self._installed_dists = {}
Expand Down

0 comments on commit 063f2ae

Please sign in to comment.