Skip to content

fix: strip VCS extras from legacy constraints exports - #376

Open
dailyun wants to merge 1 commit into
python-poetry:mainfrom
dailyun:codex/strip-vcs-extras-from-constraints-210
Open

dailyun wants to merge 1 commit into
python-poetry:mainfrom
dailyun:codex/strip-vcs-extras-from-constraints-210

Conversation

@dailyun

@dailyun dailyun commented Oct 20, 2026

Copy link
Copy Markdown

Strip features from both the dependency and package when exporting constraints. With lock format 1.1, VCS dependencies can otherwise retain extras such as foo[feature], which pip rejects in a constraints file. Requirements exports keep their extras.

Fixes #210.

Validation:

  • Four real-lock cases cover constraints/requirements with lock formats 1.1/2.1. The original source fails only the legacy constraints case; the other three pass.
  • All 182 tests pass against the patched source with Poetry 2.5.1/core 2.5.0. All 116 Exporter tests also pass with the minimum Poetry 2.1.0/core 2.1.0.
  • Pre-commit passes for the changed files. Mypy reports the same baseline diagnostics with and without the patch: one unused ignore on Poetry 2.5, and 21 existing compatibility diagnostics on 2.1. No unrelated type fixes are included.

The tests use synthetic VCS metadata without cloning or contacting the repository. OpenAI Codex assisted with the fix and tests.

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

Extras present in exported constraints.txt file

1 participant