Optimize upgrade of already-satisfied pinned requirement (#7132)

This commit is contained in:
Pradyun Gedam 2019-10-07 11:17:31 +05:30 committed by GitHub
commit f718a8f34c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
news/7132.feature Normal file
View File

@ -0,0 +1 @@
Skip reaching out to the package index, if a pinned version is already satisfied.

View File

@ -267,6 +267,10 @@ class Resolver(object):
# requirements we have to pull the tree down and inspect to assess
# the version #, so it's handled way down.
if not req_to_install.link:
if req_to_install.is_pinned:
# No need to check the index for a better version.
return 'already satisfied'
try:
self.finder.find_requirement(req_to_install, upgrade=True)
except BestVersionAlreadyInstalled: