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

Sort ManagedPythonInstallation by version #5140

Merged
merged 1 commit into from
Jul 17, 2024
Merged

Conversation

j178
Copy link
Contributor

@j178 j178 commented 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

$ 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`

@j178 j178 changed the title Sort ManagedPythonInstallation by version Sort ManagedPythonInstallation by version Jul 17, 2024
@j178 j178 force-pushed the py-version branch 3 times, most recently from c15c1a6 to 92be427 Compare July 17, 2024 06:09
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@zanieb zanieb added bug Something isn't working preview Experimental behavior labels Jul 17, 2024
@zanieb zanieb merged commit 0acb616 into astral-sh:main Jul 17, 2024
51 checks passed
@j178 j178 deleted the py-version branch July 18, 2024 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv tool run always picks up older python 3.8 over 3.12
2 participants