Warn on managed prerelease interpreters when a stable build is available#16619
Warn on managed prerelease interpreters when a stable build is available#16619zanieb merged 26 commits intoastral-sh:mainfrom
Conversation
uv run
crates/uv-python/src/downloads.rs
Outdated
| (!matches!(version, VersionRequest::Any | VersionRequest::Default)) | ||
| .then_some(version.to_string()) |
There was a problem hiding this comment.
any vs default have different semantics, should we omit it in those cases?
There was a problem hiding this comment.
Hmm, we are omitting them here right (i.e. !matches)? My understanding is we'd like to surface only the segments a user explicitly set, and these both represent (afaik) no explicit version constraint.
There was a problem hiding this comment.
Sorry, I meant "should we be omitting it"
That's fair. I think I'd expect those to be filtered in the unset_defaults method instead though?
It's a possible foot gun, in the sense that they have different semantics so omitting them could have a different result, but I can't really think of a concrete situation where this would occur. Emitting any would probably mess up the key parser anyway? :/ I'm fine omitting them until there's a problem.
There was a problem hiding this comment.
That's fair. I think I'd expect those to be filtered in the
unset_defaultsmethod instead though?
Yeah agreed, I think simplified_display should be simple in that it just filters out None values.
It's a possible foot gun, in the sense that they have different semantics so omitting them could have a different result, but I can't really think of a concrete situation where this would occur. Emitting any would probably mess up the key parser anyway? :/ I'm fine omitting them until there's a problem.
Looks like omitting anything will screw up the key parser (it expects 5 components), but since what we pass into uv python upgrade doesn't go through the key parsing flow, I think it's fine? 🤔 Especially sine omitting any/default here doesn't have any semantic loss, but I understand how if we use this for some other purpose there could be issues.
There was a problem hiding this comment.
Just as a note
Looks like omitting anything will screw up the key parser (it expects 5 components),
I was referring to PythonDownloadRequest, which is how a request for a "key" is formed and does support missing components since #14399
since what we pass into uv python upgrade doesn't go through the key parsing flow
It could, e.g., we use the generic parser
uv/crates/uv/src/commands/python/install.rs
Line 262 in caf49f8
uv/crates/uv-python/src/discovery.rs
Lines 1822 to 1824 in 60a811e
so if you request uv python upgrade 3.14-x86_64 or something that goes through the key parsing flow
| )??) | ||
| let installation = | ||
| find_best_python_installation(request, environments, preference, cache, preview)??; | ||
| installation.warn_if_outdated_prerelease(request, None); |
There was a problem hiding this comment.
Hey @terror and @zanieb, it's problematic to not always pass the python_downloads_json_url as it may warn users about versions that are not really available to them, as it does not look at the actual json that they use (if it's configured)
I think it should be passed, or not try to warn at all if python_downloads_json_url is configured
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.8` -> `0.9.9` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (astral-sh/uv)</summary> ### [`v0.9.9`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#099) [Compare Source](astral-sh/uv@0.9.8...0.9.9) Released on 2025-11-12. ##### Deprecations - Deprecate use of `--project` in `uv init` ([#​16674](astral-sh/uv#16674)) ##### Enhancements - Add iOS support to Python interpreter discovery ([#​16686](astral-sh/uv#16686)) - Reject ambiguously parsed URLs ([#​16622](astral-sh/uv#16622)) - Allow explicit values in `uv version --bump` ([#​16555](astral-sh/uv#16555)) - Warn on use of managed pre-release Python versions when a stable version is available ([#​16619](astral-sh/uv#16619)) - Allow signing trampolines on Windows by using `.rcdata` to store metadata ([#​15068](astral-sh/uv#15068)) - Add `--only-emit-workspace` and similar variants to `uv export` ([#​16681](astral-sh/uv#16681)) ##### Preview features - Add `uv workspace dir` command ([#​16678](astral-sh/uv#16678)) - Add `uv workspace metadata` command ([#​16516](astral-sh/uv#16516)) ##### Configuration - Add `UV_NO_DEFAULT_GROUPS` environment variable ([#​16645](astral-sh/uv#16645)) ##### Bug fixes - Remove `torch-model-archiver` and `torch-tb-profiler` from PyTorch backend ([#​16655](astral-sh/uv#16655)) - Fix Pixi environment detection ([#​16585](astral-sh/uv#16585)) ##### Documentation - Fix `CMD` path in FastAPI Dockerfile ([#​16701](astral-sh/uv#16701)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Resolves #16616
This PR detects managed prerelease interpreters during discovery and warns when a matching stable build is available, wiring the new helper into
PythonInstallation::find,find_best, andfind_or_download.