Fix Python version selection for scripts with a requires-python conflicting with .python-version (#18097)

See https://github.com/astral-sh/uv/issues/17717#issuecomment-3886377795

Updates `ScriptPython::from_request` to match the implementation of
`WorkspacePython::from_request` and adds filtering such that if the
`.python-version` conflicts with the `requires-python`, we prefer the
latter.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Zanie Blue
2026-02-24 05:16:48 -06:00
committed by GitHub
parent f5e00a36f0
commit f5b95ba548
5 changed files with 308 additions and 69 deletions
+1
View File
@@ -22,6 +22,7 @@ uv-cache-key = { workspace = true }
uv-client = { workspace = true }
uv-dirs = { workspace = true }
uv-distribution-filename = { workspace = true }
uv-distribution-types = { workspace = true }
uv-extract = { workspace = true }
uv-fs = { workspace = true }
uv-install-wheel = { workspace = true }