1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Pass requirement_set to _check_skip_installed

This commit is contained in:
Pradyun S. Gedam 2017-05-31 15:11:39 +05:30
parent a2447ff19b
commit c5a5121a6a
No known key found for this signature in database
GPG key ID: 55535BE71285F710

View file

@ -183,7 +183,8 @@ class Resolver(object):
assert self.upgrade_strategy == "only-if-needed"
return req.is_direct
def _check_skip_installed(self, req_to_install, finder):
# XXX: Stop passing requirement_set for options
def _check_skip_installed(self, req_to_install, requirement_set):
"""Check if req_to_install should be skipped.
This will check if the req is installed, and whether we should upgrade
@ -213,7 +214,10 @@ class Resolver(object):
# For link based requirements we have to pull the
# tree down and inspect to assess the version #, so
# its handled way down.
if not (requirement_set.force_reinstall or req_to_install.link):
should_check_possibility_for_upgrade = not (
requirement_set.force_reinstall or req_to_install.link
)
if should_check_possibility_for_upgrade:
try:
self.finder.find_requirement(
req_to_install, upgrade_allowed)
@ -272,7 +276,8 @@ class Resolver(object):
assert req_to_install.satisfied_by is None
if not requirement_set.ignore_installed:
skip_reason = self._check_skip_installed(
req_to_install, finder)
req_to_install, requirement_set
)
if req_to_install.satisfied_by:
assert skip_reason is not None, (