Skip to content

Commit

Permalink
fix: pdm 2.20.1 breaks when optional dependency groups contain unders…
Browse files Browse the repository at this point in the history
…cores (#3272)
  • Loading branch information
frostming authored Nov 11, 2024
1 parent 04f0b69 commit 91e02dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/3271.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the name normalization issue for optional dependency groups.
4 changes: 2 additions & 2 deletions src/pdm/project/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ def python_requires(self) -> PySpecSet:

def get_dependencies(self, group: str | None = None) -> Sequence[Requirement]:
metadata = self.pyproject.metadata
group = group or "default"
optional_dependencies = metadata.get("optional-dependencies", {})
group = normalize_name(group or "default")
optional_dependencies = {normalize_name(k): v for k, v in metadata.get("optional-dependencies", {}).items()}
dev_dependencies = self.pyproject.dev_dependencies
in_metadata = group == "default" or group in optional_dependencies
referred_groups: dict[str, set[str]] = {}
Expand Down

0 comments on commit 91e02dd

Please sign in to comment.