Skip to content

Commit

Permalink
locker: always use base_pep_508_name (for any constraint base_pep_508…
Browse files Browse the repository at this point in the history
…_name is equal to pretty_name)
  • Loading branch information
radoering committed Aug 25, 2022
1 parent f792e79 commit 5428048
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/poetry/packages/locker.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,7 @@ def _dump_package(self, package: Package) -> dict[str, Any]:
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

Expand Down
2 changes: 1 addition & 1 deletion tests/installation/fixtures/update-with-locked-extras.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions tests/installation/fixtures/with-pypi-repository.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5428048

Please sign in to comment.