Skip to content

feat(poetry): split python-constrained dependency variants for #31406#42701

Open
wwade wants to merge 3 commits intorenovatebot:mainfrom
wwade:split-python-markers
Open

feat(poetry): split python-constrained dependency variants for #31406#42701
wwade wants to merge 3 commits intorenovatebot:mainfrom
wwade:split-python-markers

Conversation

@wwade
Copy link
Copy Markdown

@wwade wwade commented Apr 17, 2026

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_version and
python_full_version markers, optionally split those dependencies into
separate update variants, and carry the resulting Python constraint
through branch naming and commit metadata.

What changed

  • add a splitPythonMarkers package option for pep621
  • capture marker metadata from PEP 508 dependencies and derive
    per-marker branch/commit metadata
  • intersect marker-derived Python constraints with project-level
    requires-python
  • preserve pinned lockedVersion behavior for exact-version
    dependencies when markers are split
  • reuse the same split-marker handling in Poetry extraction and
    propagate project.requires-python
  • add regression coverage for pep621 and Poetry multiple-constraint
    cases

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

wwade added 3 commits April 16, 2026 17:52
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.
@github-actions github-actions bot requested a review from viceice April 17, 2026 01:38
@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Apr 17, 2026

CLA assistant check
All committers have signed the CLA.

@cla-assistant

This comment was marked as outdated.

@wwade
Copy link
Copy Markdown
Author

wwade commented Apr 17, 2026

I'll look into the failing checks tomorrow. If there's any early feedback, that'd be helpful!


const slug = pythonConstraintToMarkerSlug(markerConstraint);
const constraintValue = intersectPythonConstraints(
dep.constraints?.python ?? packageFilePythonConstraint,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use extractedConstraints

res.extractedConstraints = { php: require.php };

Suggested change
dep.constraints?.python ?? packageFilePythonConstraint,
dep.extractedConstraints?.python ?? packageFilePythonConstraint,

if (managerData?.pep508String) {
dep.replaceString = managerData.pep508String;
}
dep.constraints = { ...dep.constraints, python: constraintValue };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
dep.constraints = { ...dep.constraints, python: constraintValue };
dep.extractedConstraints = { ...dep.extractedConstraints, python: constraintValue };

mostRecentTimestamp?: Timestamp;
isAbandoned?: boolean;

constraints?: Record<string, string>;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should be extractedConstraints, this refactoring and usage should be extracted to a separate PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants