From ff834f4eded101a1b837b0de5301290424bed9b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Randy=20D=C3=B6ring?= <30527984+radoering@users.noreply.github.com> Date: Thu, 25 Aug 2022 22:38:05 +0200 Subject: [PATCH] locker: always use base_pep_508_name (for any constraint base_pep_508_name is equal to pretty_name) --- src/poetry/packages/locker.py | 7 +------ tests/installation/fixtures/update-with-locked-extras.test | 2 +- tests/installation/fixtures/with-pypi-repository.test | 6 +++--- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/poetry/packages/locker.py b/src/poetry/packages/locker.py index 71290689da4..5a71f8a40c1 100644 --- a/src/poetry/packages/locker.py +++ b/src/poetry/packages/locker.py @@ -410,12 +410,7 @@ def _dump_package(self, package: Package) -> dict[str, Any]: if package.extras: extras = {} for name, deps in sorted(package.extras.items()): - # TODO: This should use dep.to_pep_508() once this is fixed - # https://github.com/python-poetry/poetry-core/pull/102 - extras[name] = sorted( - dep.base_pep_508_name if not dep.constraint.is_any() else dep.name - for dep in deps - ) + extras[name] = sorted(dep.base_pep_508_name for dep in deps) data["extras"] = extras diff --git a/tests/installation/fixtures/update-with-locked-extras.test b/tests/installation/fixtures/update-with-locked-extras.test index 4872311c702..3609212e222 100644 --- a/tests/installation/fixtures/update-with-locked-extras.test +++ b/tests/installation/fixtures/update-with-locked-extras.test @@ -11,7 +11,7 @@ python-versions = "*" "C" = {version = "^1.0", markers = "python_version >= \"2.7\" and python_version < \"2.8\""} [package.extras] -foo = ["b"] +foo = ["B"] [[package]] name = "B" diff --git a/tests/installation/fixtures/with-pypi-repository.test b/tests/installation/fixtures/with-pypi-repository.test index ac57e43ec7b..1bde9b82750 100644 --- a/tests/installation/fixtures/with-pypi-repository.test +++ b/tests/installation/fixtures/with-pypi-repository.test @@ -7,9 +7,9 @@ optional = false python-versions = "*" [package.extras] -dev = ["coverage", "hypothesis", "pympler", "pytest", "six", "sphinx", "zope-interface", "zope-interface"] -docs = ["sphinx", "zope-interface"] -tests = ["coverage", "hypothesis", "pympler", "pytest", "six", "zope-interface"] +dev = ["coverage", "hypothesis", "pympler", "pytest", "six", "sphinx", "zope.interface", "zope.interface"] +docs = ["sphinx", "zope.interface"] +tests = ["coverage", "hypothesis", "pympler", "pytest", "six", "zope.interface"] [[package]] name = "colorama"