mirror of https://github.com/pypa/pip
Merge pull request #7993 from uranusjr/new-resolver-normal-test-progress
Canonicalise project name from InstallationCandidate
This commit is contained in:
commit
bd912cf0de
|
@ -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):
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
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(
|
||||
|
|
Loading…
Reference in New Issue