Fix typo and simplify ireq call

This commit is contained in:
Nguyễn Gia Phong 2020-05-16 11:59:19 +07:00
parent c74577e18e
commit 29940371cc
4 changed files with 2 additions and 7 deletions

View File

@ -461,7 +461,7 @@ class RequiresPythonCandidate(Candidate):
def name(self):
# type: () -> str
# Avoid conflicting with the PyPI package "Python".
return "<Python fom Requires-Python>"
return "<Python from Requires-Python>"
@property
def version(self):

View File

@ -6,7 +6,6 @@ from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
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 .base import Requirement, Candidate
@ -105,10 +104,6 @@ class PipProvider(AbstractProvider):
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):
# type: (Union[Requirement, Candidate]) -> str
return dependency.name

View File

@ -159,7 +159,7 @@ class Resolver(BaseResolver):
req_set = RequirementSet(check_supported_wheels=check_supported_wheels)
for candidate in self._result.mapping.values():
ireq = provider.get_install_requirement(candidate)
ireq = candidate.get_install_requirement()
if ireq is None:
continue
ireq.should_reinstall = self.factory.should_reinstall(candidate)