mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Fix typo and simplify ireq call
This commit is contained in:
parent
c74577e18e
commit
29940371cc
0
news/86222709-663e-40a1-af2e-f20afab42122.trivial
Normal file
0
news/86222709-663e-40a1-af2e-f20afab42122.trivial
Normal file
|
@ -461,7 +461,7 @@ class RequiresPythonCandidate(Candidate):
|
||||||
def name(self):
|
def name(self):
|
||||||
# type: () -> str
|
# type: () -> str
|
||||||
# Avoid conflicting with the PyPI package "Python".
|
# Avoid conflicting with the PyPI package "Python".
|
||||||
return "<Python fom Requires-Python>"
|
return "<Python from Requires-Python>"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def version(self):
|
def version(self):
|
||||||
|
|
|
@ -6,7 +6,6 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
||||||
if MYPY_CHECK_RUNNING:
|
if MYPY_CHECK_RUNNING:
|
||||||
from typing import Any, Dict, Optional, Sequence, Set, Tuple, Union
|
from typing import Any, Dict, Optional, Sequence, Set, Tuple, Union
|
||||||
|
|
||||||
from pip._internal.req.req_install import InstallRequirement
|
|
||||||
from pip._vendor.packaging.version import _BaseVersion
|
from pip._vendor.packaging.version import _BaseVersion
|
||||||
|
|
||||||
from .base import Requirement, Candidate
|
from .base import Requirement, Candidate
|
||||||
|
@ -105,10 +104,6 @@ class PipProvider(AbstractProvider):
|
||||||
|
|
||||||
return sorted(matches, key=sort_key)
|
return sorted(matches, key=sort_key)
|
||||||
|
|
||||||
def get_install_requirement(self, c):
|
|
||||||
# type: (Candidate) -> Optional[InstallRequirement]
|
|
||||||
return c.get_install_requirement()
|
|
||||||
|
|
||||||
def identify(self, dependency):
|
def identify(self, dependency):
|
||||||
# type: (Union[Requirement, Candidate]) -> str
|
# type: (Union[Requirement, Candidate]) -> str
|
||||||
return dependency.name
|
return dependency.name
|
||||||
|
|
|
@ -159,7 +159,7 @@ class Resolver(BaseResolver):
|
||||||
|
|
||||||
req_set = RequirementSet(check_supported_wheels=check_supported_wheels)
|
req_set = RequirementSet(check_supported_wheels=check_supported_wheels)
|
||||||
for candidate in self._result.mapping.values():
|
for candidate in self._result.mapping.values():
|
||||||
ireq = provider.get_install_requirement(candidate)
|
ireq = candidate.get_install_requirement()
|
||||||
if ireq is None:
|
if ireq is None:
|
||||||
continue
|
continue
|
||||||
ireq.should_reinstall = self.factory.should_reinstall(candidate)
|
ireq.should_reinstall = self.factory.should_reinstall(candidate)
|
||||||
|
|
Loading…
Reference in a new issue