-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Warn on managed prerelease interpreters when a stable build is available #16619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn on managed prerelease interpreters when a stable build is available #16619
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any vs default have different semantics, should we omit it in those cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
| .map(|target| PythonRequest::parse(target.as_str())) |
uv/crates/uv-python/src/discovery.rs
Lines 1822 to 1824 in 60a811e
| if let Ok(request) = PythonDownloadRequest::from_str(value) { | |
| return Self::Key(request); | |
| } |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I missed that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.