Skip to content

Comments

Make uv pip compile always attempt to honour the --python argument#17219

Closed
EliteTK wants to merge 1 commit intotk/pip-compile-missing-py-2from
tk/pip-compile-missing-py-3
Closed

Make uv pip compile always attempt to honour the --python argument#17219
EliteTK wants to merge 1 commit intotk/pip-compile-missing-py-2from
tk/pip-compile-missing-py-3

Conversation

@EliteTK
Copy link
Contributor

@EliteTK EliteTK commented Dec 22, 2025

Summary

Addresses #16709.

Previous when uv pip compile --python <ver> was used and <ver> was a "simple Python version request" (i.e. PythonVersion::from_str succeeded) then uv pip compile would act as if the version was passed using --python-version instead (with no --python) which in turn meant that it turned into a loose requirement which could be satisfied with find_best.

This PR makes uv pip compile --python <simple-ver> act like uv pip compile --python <simple-ver> --python-version <simple-ver> which I believe is more accurate.

Test Plan

Existing tests were adjusted since they already covered this case.

This means that an explicit `uv pip compile --python <ver>` will always
attempt to honour the version.
@EliteTK EliteTK requested a review from zanieb December 22, 2025 19:44
@EliteTK EliteTK added the bug Something isn't working label Dec 22, 2025
@EliteTK EliteTK temporarily deployed to uv-test-registries December 22, 2025 19:47 — with GitHub Actions Inactive
@EliteTK EliteTK marked this pull request as draft December 29, 2025 13:16
@EliteTK EliteTK closed this Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant