canonicalize dependency group names#10387
Conversation
Reviewer's GuideThis PR introduces consistent normalization of dependency group names across the codebase by using packaging.utils.canonicalize_name (NormalizedName) in type hints, data processing (locker, solver, transaction, transitive info), CLI commands, and tests, and updates the pyproject.toml to reference the poetry-core Git URL as required. Updated Class Diagrams for Command ClassesclassDiagram
class GroupCommand {
+activated_groups: set[NormalizedName]
}
class InstallCommand {
+activated_groups: set[NormalizedName]
}
class SelfCommand {
+ADDITIONAL_PACKAGE_GROUP: NormalizedName
+activated_groups: set[NormalizedName]
}
class SelfShowCommand {
+activated_groups: set[NormalizedName]
}
SelfCommand <|-- SelfShowCommand
class SelfInstallCommand {
+activated_groups: set[NormalizedName]
}
SelfCommand <|-- SelfInstallCommand
InstallCommand <|-- SelfInstallCommand
Updated Class Diagram for TransitivePackageInfoclassDiagram
class TransitivePackageInfo {
+depth: int
+groups: set[NormalizedName]
+markers: dict[NormalizedName, BaseMarker]
+get_marker(groups: Iterable[NormalizedName]) BaseMarker
}
Updated Class Diagram for LockerclassDiagram
class Locker {
+locked_packages() dict[Package, TransitivePackageInfo]
#_dump_package(package: Package, transitive_info: TransitivePackageInfo, dependencies: dict[str, list[str]]) Table
}
Updated Class Diagram for InstallerclassDiagram
class Installer {
-_groups: Iterable[NormalizedName] | None
+only_groups(groups: Iterable[NormalizedName]) Installer
}
Updated Class Diagram for TransactionclassDiagram
class Transaction {
+__init__(..., groups: set[NormalizedName] | None)
}
Updated Class Diagram for PackageNodeclassDiagram
class PackageNode {
+groups: frozenset[NormalizedName]
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @radoering - I've reviewed your changes - here's some feedback:
- The
DEV_GROUPconstant is defined locally in multiple test files; consider using a shared definition, possibly frompoetry-coreif appropriate, similar toMAIN_GROUP.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
I do not think it is worth it: While the name of the main group is really a constant, "dev" is not. It is just "coincidence" that multiple tests use the same arbitrary group name. Moving this one liner into a common module and replacing it by an import, is probably not worth it. |
0c786c9 to
a7cbe23
Compare
There was a problem hiding this comment.
Hey @radoering - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
a7cbe23 to
daa3f20
Compare
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Requires: python-poetry/poetry-core#868
Summary by Sourcery
Normalize dependency group handling by canonicalizing group names across API, CLI, lock file parsing/dumping, and tests to ensure consistent use of packaging.utils.canonicalize_name.
Bug Fixes:
Enhancements:
Build:
Tests: