avoid spurious empty-constraint conflict with duplicates across extras#10943
Open
dimbleby wants to merge 1 commit into
Open
avoid spurious empty-constraint conflict with duplicates across extras#10943dimbleby wants to merge 1 commit into
dimbleby wants to merge 1 commit into
Conversation
… across extras When duplicate dependencies on the same package had different extras (e.g. the package appeared in multiple project.optional-dependencies entries and was also required with an extra by a dependency group), _resolve_overlapping_markers synthesised a 'not required' empty-constraint dependency for the leftover marker space of each subgroup. That synthetic dep conflicted with the sibling subgroup, causing 'depends on both X (*) and X (<empty>)' resolution failures. Make the leftover-marker-space placeholder opt-in via a new `cover_leftover_marker_space` flag, and only enable it for the single-complete-name caller that actually needs it. Fixes python-poetry#10447 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
cover_leftover_marker_spaceflag introduces a subtle behavioral fork in_resolve_overlapping_markers; consider either documenting its semantics and intended callers more explicitly in the docstring or splitting into two dedicated helpers to avoid boolean-flag-driven behavior. - The comment in the non-
single_complete_namebranch explains whycover_leftover_marker_spacemust be false there; it might be helpful to add a short in-code assertion or helper naming to enforce that assumption and make future regressions around leftover marker space harder to reintroduce.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `cover_leftover_marker_space` flag introduces a subtle behavioral fork in `_resolve_overlapping_markers`; consider either documenting its semantics and intended callers more explicitly in the docstring or splitting into two dedicated helpers to avoid boolean-flag-driven behavior.
- The comment in the non-`single_complete_name` branch explains why `cover_leftover_marker_space` must be false there; it might be helpful to add a short in-code assertion or helper naming to enforce that assumption and make future regressions around leftover marker space harder to reintroduce.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Related Knowledge 1 document with suggested updates is ready for review. Python Poetry CHANGELOG
|
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.
I think this is probably right - the testcase is good anyway, and the fix looks likely...
When duplicate dependencies on the same package had different extras (e.g. the package appeared in multiple project.optional-dependencies entries and was also required with an extra by a dependency group), _resolve_overlapping_markers synthesised a 'not required' empty-constraint dependency for the leftover marker space of each subgroup. That synthetic dep conflicted with the sibling subgroup, causing 'depends on both X (*) and X ()' resolution failures.
Make the leftover-marker-space placeholder opt-in via a new
cover_leftover_marker_spaceflag, and only enable it for the single-complete-name caller that actually needs it.Fixes #10447