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

uv python install and uninstall now account for the UV_PYTHON env var #10222

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Choudhry18
Copy link

@Choudhry18 Choudhry18 commented Dec 29, 2024

Summary

Checks UV_PYTHON for version when uv python install or uv python uninstall ran

Test Plan

I added new snapshot tests:
uv/tests/it/python_install::python_install_with_uv_python_env that sets UV_PYTHON to and tests if that version is installed and not the latest. UV_PYTHON=3.12 uv python install would install 3.12 and not the latest version

uv/tests/it/python_install::python_install_with_uv_python_env_and_arg that sets the env variable and the target and tests if the target takes precedence. UV_PYTHON=3.12 uv python install 3.8 would install python 3.8

Requirement Concern

The order of precedence on the python install command is : target specified through cli -> environment var UV_PYTHON -> .python-versions if none other specified.

The order of precedence on the python uninstall command is: target specified through cli (required unless UV_PYTHON set) -> environment var UV_PYTHON (required unless target provided in cli). As the --all arg conflicts with target it also conflicts UV_PYTHON env variable

closes #10128

@zanieb zanieb self-assigned this Dec 30, 2024
crates/uv/src/settings.rs Outdated Show resolved Hide resolved
@Choudhry18 Choudhry18 requested a review from samypr100 January 3, 2025 10:04
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 install should recognize the UV_PYTHON environment variable
3 participants