Skip to content

Respect --global Python pins during uv tool operations #12921

@jtfmumm

Description

@jtfmumm

We currently support pinning a global Python version via uv python pin 3.12 --global. But uv tool operations do not use this global pin. They should also respect the global pin (when a local Python version pin is not found in the working directory or an ancestor directory).

There is still design work to do here. It seems pretty clear that the above behavior should apply when installing a tool for the first time. But we have to determine how uv tool should behave on reinstalls and upgrades. Should it respect the global pin or the version it was originally installed with? If the latter, should we only ignore the global pin if the version was originally explicitly set with --python?

It seems intuitive that installing with --python would ensure that future reinstalls and upgrades would use the same version. My inclination is that otherwise the global pin should be respected, even if it has changed since a tool was initially installed. That allows uv to be consistent in how it looks up the Python version to use (with --python always taking precedence).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions