-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Issue Kind
Change in current behaviour
Description
When upgrading poetry to 2.2.0 and beyond, names of dependency groups are now silently normalized: #10387 which can act as a breaking change.
Updating a lock file after the upgrade breaks any automation that depends on groups with names subject to normalization.
Personal example. I bumped a dependency in pyproject.toml and updated the lock file. Because I happened to have the latest poetry, while the lock in the repo was generated with 2.1.4, the normalization changed the names of the groups in the lock file. This was overlooked in the review process, as the changes in the lock file tend to be. As a result, after CI has "successfully" installed the dependencies and deployed the code, some dependencies were missing. It wasn't exactly obvious why at the time.
I think it would be a good idea to either:
- output a warning during
poetry lockwhen a dependency name is normalized - return an error when using
--withoption when specified group name does not exist in the lock file
Impact
Introduces guardrails to avoid breaking behaviour. Communicates clearly the modifications applied.
Workarounds
- Make sure the names of the dependency groups in the lock file are the same as the ones in the toml.
- Rename the dependency groups in the toml