Skip to content

fix: do not fail when uninstalling a path dependency whose source is gone - #11093

Merged
radoering merged 1 commit into
python-poetry:mainfrom
kwy404:fix-sync-removed-directory-dep
Sep 27, 2026
Merged

radoering merged 1 commit into
python-poetry:mainfrom
kwy404:fix-sync-removed-directory-dep

Conversation

@kwy404

@kwy404 kwy404 commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Resolves: #9054

When a path dependency is removed from the project and its directory is gone, poetry sync failed while validating the uninstall operation because the source path no longer exists. Uninstalling does not need the source, so the validation no longer raises for uninstall operations.

  • Added tests for changed code.
  • Updated documentation for changed code.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If the uninstall operation is incorrectly admitted, the installer will delete the installed path dependency even though its source cannot be validated. Reverting the change would stop future cases but would not restore package files already removed, although the impact is limited to the affected installation and may be repairable by reinstalling from another source.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@MateehUllah MateehUllah left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the current patch. Skipping source-path validation specifically for uninstall operations is appropriate because removing an already-installed directory or file dependency does not require its original source to remain available. Validation remains unchanged for install and update operations, while the regression test reproduces synchronization with a missing directory dependency and verifies that the removal is scheduled successfully. I did not find a blocking correctness issue.

@radoering
radoering force-pushed the fix-sync-removed-directory-dep branch from 00cb16b to dbd5855 Compare September 27, 2026 09:57
@radoering
radoering enabled auto-merge (squash) September 27, 2026 09:58
@radoering
radoering merged commit b486b0f into python-poetry:main Sep 27, 2026
61 checks passed
@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

poetry install --sync fails if a previously installed local editable package has been removed without using poetry remove

3 participants