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

Respect the libc of the execution environment with uv python list #5036

Merged
merged 4 commits into from
Jul 14, 2024

Conversation

Di-Is
Copy link
Contributor

@Di-Is Di-Is commented Jul 13, 2024

Fix #4988

Summary

Running uv python list on glibc-based Linux will list musl pythons.

$ uv version
uv 0.2.24
$ uv python list
warning: `uv python list` is experimental and may change without warning.
cpython-3.12.3-linux-x86_64-musl     <download available>
cpython-3.12.3-linux-x86_64-gnu      /usr/bin/python3
cpython-3.12.3-linux-x86_64-gnu      /bin/python3
cpython-3.11.9-linux-x86_64-musl     <download available>
cpython-3.10.14-linux-x86_64-musl    <download available>
cpython-3.9.19-linux-x86_64-musl     <download available>
cpython-3.8.19-linux-x86_64-musl     <download available>
cpython-3.7.9-linux-x86_64-musl      <download available>

Change it to show Python matching the environment's libc as follows.

$ uv python list
warning: `uv python list` is experimental and may change without warning.
cpython-3.12.3-linux-x86_64-gnu     /usr/bin/python3
cpython-3.12.3-linux-x86_64-gnu     /bin/python3
cpython-3.12.3-linux-x86_64-gnu     <download available>
cpython-3.11.9-linux-x86_64-gnu     <download available>
cpython-3.10.14-linux-x86_64-gnu    <download available>
cpython-3.9.19-linux-x86_64-gnu     <download available>
cpython-3.8.19-linux-x86_64-gnu     <download available>
cpython-3.7.9-linux-x86_64-gnu      <download available>

Also, if --all-platforms is specified, change to list Python for all architectures and libc.

$ uv python list --all-platforms
warning: `uv python list` is experimental and may change without warning.
cpython-3.12.3-windows-x86_64-none       <download available>
cpython-3.12.3-windows-x86-none          <download available>
cpython-3.12.3-macos-x86_64-none         <download available>
cpython-3.12.3-macos-aarch64-none        <download available>
cpython-3.12.3-linux-x86_64-musl         <download available>
cpython-3.12.3-linux-x86_64-gnu          /usr/bin/python3
cpython-3.12.3-linux-x86_64-gnu          /bin/python3
cpython-3.12.3-linux-x86_64-gnu          <download available>
cpython-3.12.3-linux-s390x-gnu           <download available>
cpython-3.12.3-linux-powerpc64le-gnu     <download available>
cpython-3.12.3-linux-armv7-gnueabihf     <download available>
cpython-3.12.3-linux-armv7-gnueabi       <download available>
cpython-3.12.3-linux-aarch64-gnu         <download available>
...

Test Plan

The following commands were executed on the command line to confirm the results in Ubuntu 24.04.

  • cargo run python list
  • cargo run python list --all-platforms

@Di-Is Di-Is changed the title Fix python list Respect the libc of the execution environment with uv python list. Jul 13, 2024
@zanieb
Copy link
Member

zanieb commented Jul 13, 2024

Thank you! Note we don't have proper musl detection yet (see #4160 and #4242)

@Di-Is Di-Is changed the title Respect the libc of the execution environment with uv python list. Respect the libc of the execution environment with uv python list Jul 14, 2024
@Di-Is
Copy link
Contributor Author

Di-Is commented Jul 14, 2024

Hi @zanieb!

I see, the function to detect the type of libc has not been implemented yet.
Since various conflicts are likely to occur, we will not make any changes to this MR for now.

I hope that the problem reported in #4988 will be fixed somehow.

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.

I think this is an improvement regardless of our detection abilities, thank you!

@zanieb zanieb merged commit 720ae19 into astral-sh:main Jul 14, 2024
49 checks passed
@Di-Is Di-Is deleted the fix-python-list branch July 19, 2024 06:29
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 this pull request may close these issues.

uv python list doesn't show all possible combinations of python installation
2 participants