Avoid selecting prerelease Python installations without opt-in (#7300)

Similar to our semantics for packages with pre-release versions.

We will not use prerelease versions unless there are only prerelease
versions available, a specific version is requested,
or the prerelease version is found in a reasonable source (active
environment, explicit path, etc. but not `PATH`).

For example, `uv python install 3.13 && uv run python --version` will no
longer use `3.13.0rc2` unless that is the only Python version available,
`--python 3.13` is used, or that's the Python version that is present in
`.venv`.
This commit is contained in:
Zanie Blue 2024-09-11 15:49:33 -05:00 committed by GitHub
parent c124cda098
commit f22e5ef69a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 84 additions and 15 deletions

View file

@ -189,6 +189,17 @@ a system Python version, uv will use the first compatible version — not the ne
If a Python version cannot be found on the system, uv will check for a compatible managed Python
version download.
### Python pre-releases
Python pre-releases will not be selected by default. Python pre-releases will be used if there is no
other available installation matching the request. For example, if only a pre-release version is
available it will be used but otherwise a stable release version will be used. Similarly, if the
path to a pre-release Python executable is provided then no other Python version matches the request
and the pre-release version will be used.
If a pre-release Python version is available and matches the request, uv will not download a stable
Python version instead.
## Disabling automatic Python downloads
By default, uv will automatically download Python versions when needed.