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

Change to show only the python installed on the system if --python-preference only-system is specified #5219

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

Di-Is
Copy link
Contributor

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

Fix #5211

Summary

Change to show only the python installed on the system if --python-preference only-system is specified.

Below is an example of running the command before the change, showing Python not installed on the system.

Before

# Check system python
$ uv python --preview list --python-preference only-system
cpython-3.12.4-linux-x86_64-gnu     <download available>
cpython-3.12.3-linux-x86_64-gnu     /usr/bin/python3.12
cpython-3.12.3-linux-x86_64-gnu     /usr/bin/python3
cpython-3.12.3-linux-x86_64-gnu     /bin/python3.12
cpython-3.12.3-linux-x86_64-gnu     /bin/python3
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>

This PR changes the display to show only Python installed on the system.

After

$ cargo run python --preview list --python-preference only-system
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.11s
     Running `target/debug/uv python list --python-preference only-system --preview`
cpython-3.12.3-linux-x86_64-gnu    /usr/bin/python3.12
cpython-3.12.3-linux-x86_64-gnu    /usr/bin/python3
cpython-3.12.3-linux-x86_64-gnu    /bin/python3.12
cpython-3.12.3-linux-x86_64-gnu    /bin/python3

Test Plan

  • cargo run python list --python-preference only-system in Ubuntu 24.04 to verify the display.
  • cargo run python list in Ubuntu 24.04 to verify that the results before and after the change were the same.

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 cli Related to the command line interface preview Experimental behavior labels Jul 19, 2024
@zanieb zanieb enabled auto-merge (squash) July 19, 2024 14:13
@zanieb zanieb merged commit 0d9d559 into astral-sh:main Jul 19, 2024
54 checks passed
@Di-Is Di-Is deleted the fix-python-list-specified-system-only branch July 20, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The result of uv python list --python-preference only-system shows unwanted python
2 participants