Merge pull request #8974 from NoahGorny/fix-new-resolver-upgrades-when-not-needed-to

This commit is contained in:
Pradyun Gedam 2020-10-10 20:41:48 +05:30 committed by GitHub
commit 063f2ae74e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

2
news/8963.bugfix.rst Normal file
View File

@ -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)

View File

@ -98,9 +98,15 @@ class Factory(object):
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 = {}