Skip to content
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

uv tool run always picks up older python 3.8 over 3.12 #5139

Closed
j178 opened this issue Jul 17, 2024 · 0 comments · Fixed by #5140
Closed

uv tool run always picks up older python 3.8 over 3.12 #5139

j178 opened this issue Jul 17, 2024 · 0 comments · Fixed by #5140

Comments

@j178
Copy link
Contributor

j178 commented Jul 17, 2024

$ uv python install 3.8 3.12

$ uv tool run -v httpx
DEBUG uv 0.2.25
warning: `uv tool run` is experimental and may change without warning.
DEBUG Searching for Python interpreter in managed installations or system path
DEBUG Searching for managed installations at `/Users/didi/Library/Application Support/uv/python`
DEBUG Found managed Python `cpython-3.8.19-macos-x86_64-none`
DEBUG Found cpython 3.8.19 at `/Users/didi/Library/Application Support/uv/python/cpython-3.8.19-macos-x86_64-none/bin/python3` (managed installations)
DEBUG Using request timeout of 30s
DEBUG Using request timeout of 30s
DEBUG Acquired lock for `/Users/didi/Library/Application Support/uv/tools`
DEBUG Caching via interpreter: `/Users/didi/Library/Application Support/uv/python/cpython-3.8.19-macos-x86_64-none/bin/python3`
DEBUG Using request timeout of 30s
DEBUG Solving with installed Python version: 3.8.19
DEBUG Adding direct dependency: httpx*
...
zanieb pushed a commit that referenced this issue Jul 17, 2024
## Summary
Resolves #5139

`PythonInstallationKey` was sorted as a string, which caused `3.8` to
appear before `3.11`. This update changes the sorting of
`PythonInstallationKey` to be a descending order by version.

## Test Plan
```sh
$ cargo run -- python install 3.8 3.12
$ cargo run -- tool run -v python -V
DEBUG uv 0.2.25
warning: `uv tool run` is experimental and may change without warning.
DEBUG Searching for Python interpreter in managed installations, system path, or `py` launcher
DEBUG Searching for managed installations at `C:\Users\xx\AppData\Roaming\uv\data\python`
DEBUG Found managed Python `cpython-3.12.3-windows-x86_64-none`
DEBUG Found cpython 3.12.3 at `C:\Users\xx\AppData\Roaming\uv\data\python\cpython-3.12.3-windows-x86_64-none\install\python.exe` (managed installations)
DEBUG Using request timeout of 30s
DEBUG Using request timeout of 30s
DEBUG Acquired lock for `C:\Users\nigel\AppData\Roaming\uv\data\tools`
DEBUG Using existing environment for tool `httpx`: C:\Users\xx\AppData\Roaming\uv\data\tools\httpx
DEBUG Using existing tool `httpx`
DEBUG Running `httpx -v`
```
charliermarsh added a commit that referenced this issue Jul 19, 2024
## Summary

See: #5139 and
#5201 (comment).

## Test Plan

Verified that 3.12 was chosen above 3.8 in:

- `cargo run -- python uninstall --all`
- `cargo run -- python install 3.8 3.12`
- `cargo run -- tool run -v httpx`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant