提交 a23e936b 编写于 作者: P Paul Moore

Ensure candidate name is canonicalised

上级 f1b4be89
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.req.constructors import install_req_from_line
from pip._internal.req.req_install import InstallRequirement
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
......@@ -76,7 +78,7 @@ class LinkCandidate(Candidate):
def name(self):
# type: () -> str
if self._name is None:
self._name = self.dist.project_name
self._name = canonicalize_name(self.dist.project_name)
return self._name
@property
......
......@@ -103,6 +103,8 @@ class SpecifierRequirement(Requirement):
def is_satisfied_by(self, candidate):
# type: (Candidate) -> bool
assert candidate.name == self.name, \
"Internal issue: Candidate is not for this requirement"
"Internal issue: Candidate is not for this requirement " \
" {} vs {}".format(candidate.name, self.name)
return candidate.version in self._ireq.req.specifier
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册