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 authored and neersighted committed Aug 26, 2022
1 parent 9fb6c95 commit 5f2d2b8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
7 changes: 1 addition & 6 deletions src/poetry/packages/locker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

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 5f2d2b8

Please sign in to comment.