Repository navigation
Conversation
When running 'poetry remove <package>', optional dependencies declared in [project.optional-dependencies] or [tool.poetry.extras] were not found, causing a 'packages were not found' error. This adds a _remove_optional_packages method that searches both PEP 621 optional-dependencies sections and legacy poetry extras/optional markers, cleaning up empty sections after removal. Fixes #10703
|
🧙 Sourcery has finished reviewing your pull request! Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
We failed to fetch the diff for pull request #10726
You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.
|
what if a user wants to remove an optional dependency from one set of extras but not another? or from the main dependencies but not from extras? I'm not convinced that everything has to be supported from the command line - just edit the pyproject.toml! - but if we start to go down this path there are lots more cases to think about. |
|
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. |
Fixes #10703
The remove command never searched [project.optional-dependencies] or [tool.poetry.extras] sections, causing 'packages were not found' for optional deps.
Added _remove_optional_packages() to search both PEP 621 and legacy optional dependency sections, with cleanup of empty sections. Added two regression tests.
Summary by Sourcery
Handle removal of optional dependencies across both modern and legacy configuration formats when running the remove command.
Bug Fixes:
Tests: