fix: reinstall editable dependencies when develop mode changes - #11022
Open
yangfan-yf-yf wants to merge 1 commit into
Open
fix: reinstall editable dependencies when develop mode changes#11022yangfan-yf-yf wants to merge 1 commit into
yangfan-yf-yf wants to merge 1 commit into
Conversation
yangfan-yf-yf
marked this pull request as ready for review
August 26, 2026 11:06
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the develop-mode comparison is wrong, Poetry may reinstall a directory or Git dependency in the wrong mode, leaving the environment in an incorrect but repairable state after the code is reverted. Reverting stops future incorrect operations, but an affected environment would need the dependency to be reinstalled or synchronized again.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves: #7088
Addresses the editable/non-editable sync transition described in #10666.
Summary
When a directory or Git dependency kept the same name, version, and source but
changed between editable and non-editable mode,
Transaction.calculate_operations()treated the installed and resolvedpackages as unchanged. As a result,
poetry syncdid not reinstall thedependency and left its previous install mode in place.
Treat a change to the package's
developflag as an update condition for thedirectory and Git source types that support editable installs. Registry, URL,
and file packages continue to ignore this field. Legacy editable directory
installs discovered through a plain-text
.pthfile are also marked aseditable, so switching one of those installs to non-editable schedules the
required update.
This does not address the separate transitive dependency metadata problem
described in #10683, where a PEP 621 dependency loses
develop = truewhilethe lock file is built.
Validation
.pthbehavior, and PEP 610 editable metadata
git diff --checkpassedPull Request Check List
configuration documentation changes are required.