uv/crates/uv-python/src
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
..
discovery.rs Add support for serializing `PythonRequest` to a canonical string (#4949) 2024-07-10 10:24:45 -05:00
downloads.inc Update standalone Pythons to include 3.12.4 (#5042) 2024-07-14 01:51:47 +00:00
downloads.inc.mustache Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
downloads.rs Respect the libc of the execution environment with `uv python list` (#5036) 2024-07-14 11:14:57 -05:00
environment.rs Initialize all `--prefix` subdirectories (#4895) 2024-07-08 14:15:25 +00:00
implementation.rs Deduplicate when install or uninstall python (#4841) 2024-07-05 22:05:17 -05:00
installation.rs Sort `ManagedPythonInstallation` by version (#5140) 2024-07-17 09:48:04 -05:00
interpreter.rs Initialize all `--prefix` subdirectories (#4895) 2024-07-08 14:15:25 +00:00
lib.rs Respect `--isolated` in `uv python install` (#4938) 2024-07-10 15:36:25 +00:00
managed.rs Sort `ManagedPythonInstallation` by version (#5140) 2024-07-17 09:48:04 -05:00
platform.rs Deduplicate when install or uninstall python (#4841) 2024-07-05 22:05:17 -05:00
pointer_size.rs Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
prefix.rs Initialize all `--prefix` subdirectories (#4895) 2024-07-08 14:15:25 +00:00
py_launcher.rs Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
python_version.rs Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
target.rs Change "toolchain" to "python" (#4735) 2024-07-03 07:44:29 -05:00
version_files.rs Respect `--isolated` in `uv python install` (#4938) 2024-07-10 15:36:25 +00:00
virtualenv.rs Add reference documentation for global settings (#5123) 2024-07-16 20:50:04 +00:00