4ae86f9b0a
Closes #12921 For `uv tool run`, we'll just use the global Python version for all invocations without an explicit alternative request (i.e., via the `--python` flag). For `uv tool install`, it's a bit more complicated: - If the tool is not installed, we'll use the global Python version - If the tool is already installed, we won't change the Python version unless `--reinstall` or `--python` is used - If the tool was installed with `--python`, we won't use the global Python version, unless the tool is uninstalled first The behavior can be demonstrated as follows ``` $ uv python pin --global 3.12 $ uv tool install flask # uses 3.12 $ uv tool install flask # no-op $ uv python pin --global 3.13 $ uv tool install flask # no-op $ uv tool install flask --reinstall # uses 3.13 $ uv tool install flask -p 3.12 # uses 3.12 $ uv tool install flask # no-op $ uv tool install flask --reinstall # uses 3.12 ``` This is a little more complicated than always reinstalling when the global Python version pin changes, but I think it's probably more intuitive when actually using the tool. We briefly touched on this when adding global version pins at https://github.com/astral-sh/uv/pull/12115#discussion_r1992222278 Minor note: I need to do a self-review of this implementation, as it's a little awkward to encode this behavior in the existing logic.
uv-python
This crate is an internal component of uv. The Rust API exposed here is unstable and will have frequent breaking changes.
This version (0.0.19) is a component of uv 0.9.30. The source can be found here.
See uv's crate versioning policy for details on versioning.