Skip to content

Pass the constraints to uv with --constraint, known to every uv version - #87

Open
morisil wants to merge 3 commits into
mainfrom
issue-75-uv-constraint
Open

morisil wants to merge 3 commits into
mainfrom
issue-75-uv-constraint

Conversation

@morisil

@morisil morisil commented Nov 12, 2026

Copy link
Copy Markdown
Member

Fixes #75

uv pip install now gets the constraints of the dependency directory with --constraint, accepted by every uv version, instead of --constraints, an alias only since uv 0.5.4 — so with uv 0.2.x–0.5.3 on the PATH every dependency install failed with unexpected argument '--constraints' found.

  • The --target / --constraint / dependency arguments are built once and shared by the uv and pip commands, so they can't drift apart again; the pip command is unchanged.
  • Tests: a fake uv script recording its arguments (runs everywhere but Windows, also in CI); two real-uv tests, skipped without uv on the PATH, installing a locally built wheel — one satisfying the constraint, one violating it (failing with the constraint named), so the constraint is proven applied, not just accepted.
  • Verified with uv 0.2.29, 0.2.30, 0.3.0, 0.4.0, 0.4.15, 0.5.0, 0.5.3, 0.5.4, 0.8.0, 0.9.5 (--rerun --no-daemon with each on the PATH).

Squash note: the first commit's subject says "before 0.5.1" — the alias actually appeared in 0.5.4 (bisected during the review); please reword when squashing.

Review

2 rounds: 1st — only blocking item was the wrong version in comments (fixed); 2nd — no blocking findings. Polish applied: shared arguments, violating-constraint test tied to the constraint.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG

morisil and others added 3 commits November 11, 2026 23:53
…75)

uv 0.2.30 to 0.5.0 reject its --constraints alias, so every installation
with such a uv on the PATH failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
… applied (#75)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FJmHQ3jHRbVdpwUiNUkApG
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.

uv before 0.5.4 rejects --constraints, so no dependency can be installed with it

1 participant