Merge pull request #8185 from uranusjr/contain-include-prereleases

This commit is contained in:
Pradyun Gedam 2020-05-05 18:13:56 +05:30 committed by GitHub
commit a395afba81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -161,9 +161,10 @@ class Factory(object):
# Return installed distribution if it matches the specifier. This is
# done last so the resolver will prefer it over downloading links.
if (installed_dist is not None and
not can_upgrade and
installed_dist.parsed_version in ireq.req.specifier):
if can_upgrade or installed_dist is None:
return
installed_version = installed_dist.parsed_version
if ireq.req.specifier.contains(installed_version, prereleases=True):
yield self._make_candidate_from_dist(
dist=installed_dist,
extras=extras,