Skip to content

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

Merged
radoering merged 1 commit into
python-poetry:mainfrom
dailyun:codex/strip-vcs-extras-from-constraints-210
Nov 21, 2026
Merged

radoering merged 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
Contributor

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

@radoering
radoering force-pushed the codex/strip-vcs-extras-from-constraints-210 branch from e2ce84a to 34d51f0 Compare November 21, 2026 12:39
@sonarqubecloud

Copy link
Copy Markdown

@radoering
radoering merged commit 36ab718 into python-poetry:main Nov 21, 2026
21 checks passed
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

2 participants