feat(poetry): split python-constrained dependency variants for #31406#42701
Open
wwade wants to merge 3 commits intorenovatebot:mainfrom
Open
feat(poetry): split python-constrained dependency variants for #31406#42701wwade wants to merge 3 commits intorenovatebot:mainfrom
wwade wants to merge 3 commits intorenovatebot:mainfrom
Conversation
Store python marker metadata and add the splitPythonMarkers option so pep621 extraction can preserve separate dependency variants. This lays the groundwork for supporting multiple constrained dependencies reported in renovatebot#31406.
Apply marker-derived python constraints during pep621 extraction so Renovate can create distinct updates for each constrained dependency variant instead of collapsing them together. This addresses the multiple-constraint dependency case behind renovatebot#31406.
Reuse the pep621 split-marker handling during Poetry extraction so project dependencies with multiple python-constrained variants produce separate constrained updates. This extends the renovatebot#31406 fix to Poetry projects.
This comment was marked as outdated.
This comment was marked as outdated.
Author
|
I'll look into the failing checks tomorrow. If there's any early feedback, that'd be helpful! |
viceice
reviewed
Apr 17, 2026
|
|
||
| const slug = pythonConstraintToMarkerSlug(markerConstraint); | ||
| const constraintValue = intersectPythonConstraints( | ||
| dep.constraints?.python ?? packageFilePythonConstraint, |
Member
There was a problem hiding this comment.
use extractedConstraints
Suggested change
| dep.constraints?.python ?? packageFilePythonConstraint, | |
| dep.extractedConstraints?.python ?? packageFilePythonConstraint, |
| if (managerData?.pep508String) { | ||
| dep.replaceString = managerData.pep508String; | ||
| } | ||
| dep.constraints = { ...dep.constraints, python: constraintValue }; |
Member
There was a problem hiding this comment.
Suggested change
| dep.constraints = { ...dep.constraints, python: constraintValue }; | |
| dep.extractedConstraints = { ...dep.extractedConstraints, python: constraintValue }; |
| mostRecentTimestamp?: Timestamp; | ||
| isAbandoned?: boolean; | ||
|
|
||
| constraints?: Record<string, string>; |
Member
There was a problem hiding this comment.
should be extractedConstraints, this refactoring and usage should be extracted to a separate PR
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.
Summary
Fix support for multiple Python-constrained dependency variants in
pyproject.toml, including Poetry projects affected by #31406.This change teaches extraction to preserve simple
python_versionandpython_full_versionmarkers, optionally split those dependencies intoseparate update variants, and carry the resulting Python constraint
through branch naming and commit metadata.
What changed
splitPythonMarkerspackage option forpep621per-marker branch/commit metadata
requires-pythonlockedVersionbehavior for exact-versiondependencies when markers are split
propagate
project.requires-pythonpep621and Poetry multiple-constraintcases
Why
Before this change, dependencies declared as multiple Python-specific
variants could be flattened together during extraction, which prevented
Renovate from handling each constrained variant independently. That is
the behavior reported in #31406.
Testing
pep621marker parsing andextraction
pinned versions