Stabilize Python upgrades (#17766)

Includes a few things...

- Drops preview warnings for use of `uv python upgrade` and `uv python
install --upgrade`
- Adds `--resolve-links` to `uv python find`, which I needed in test
cases to retain existing snapshots
- Fixes issues in our "Using environment ..." messages on Windows which
were incorrect
- Refactors `from_executable` for the `PythonMinorVersionLink` type
(https://github.com/astral-sh/uv/pull/17842/commits/28b2ed2525327d94fdf5372a29bbbc476d74680f)
to use the type system to prevent incorrect construction (for above)
- Removes special casing where we only upgrade links if they already
exist, which existed so preview wasn't needed on every invocation
- Fixes a bug with `PythonMinorVersionLink::exists` which returned
`true` even if the link pointed to the wrong Python installation leading
to discovery failures
This commit is contained in:
Zanie Blue
2026-02-05 11:26:54 -06:00
parent f3d50129c6
commit d2ab2d0208
35 changed files with 221 additions and 239 deletions
+6
View File
@@ -6426,6 +6426,12 @@ pub struct PythonFindArgs {
#[arg(long)]
pub show_version: bool,
/// Resolve symlinks in the output path.
///
/// When enabled, the output path will be canonicalized, resolving any symlinks.
#[arg(long)]
pub resolve_links: bool,
/// URL pointing to JSON of custom Python installations.
#[arg(long, value_hint = ValueHint::Other)]
pub python_downloads_json_url: Option<String>,