uv/crates/uv-python
Jo 0acb6165dc
Sort ManagedPythonInstallation by version (#5140)
## 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`
```
2024-07-17 09:48:04 -05:00
..
python Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
src Sort ManagedPythonInstallation by version (#5140) 2024-07-17 09:48:04 -05:00
Cargo.toml Add progress bar when downloading python (#4840) 2024-07-07 20:01:35 +00:00
download-metadata.json Update standalone Pythons to include 3.12.4 (#5042) 2024-07-14 01:51:47 +00:00
fetch-download-metadata.py Use install_only python archive (#4843) 2024-07-06 21:43:55 -05:00
template-download-metadata.py Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00