未验证 提交 bd912cf0 编写于 作者: P Paul Moore 提交者: GitHub

Merge pull request #7993 from uranusjr/new-resolver-normal-test-progress

Canonicalise project name from InstallationCandidate
......@@ -163,10 +163,19 @@ class _InstallRequirementBackedCandidate(Candidate):
# These should be "proper" errors, not just asserts, as they
# can result from user errors like a requirement "foo @ URL"
# when the project at URL has a name of "bar" in its metadata.
assert (self._name is None or
self._name == canonicalize_name(self._dist.project_name))
assert (self._version is None or
self._version == self.dist.parsed_version)
assert (
self._name is None or
self._name == canonicalize_name(self._dist.project_name)
), "Name mismatch: {!r} vs {!r}".format(
self._name, canonicalize_name(self._dist.project_name),
)
assert (
self._version is None or
self._version == self._dist.parsed_version
), "Version mismatch: {!r} vs {!r}".format(
self._version, self._dist.parsed_version,
)
return self._dist
def _get_requires_python_specifier(self):
......
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.pkg_resources import (
DistributionNotFound,
VersionConflict,
......@@ -121,7 +122,7 @@ class Factory(object):
link=ican.link,
extras=extras,
parent=parent,
name=ican.name,
name=canonicalize_name(ican.name),
version=ican.version,
)
return self._make_candidate_from_dist(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册