Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support pre-releases in Python version requests - `command --python <…
…major.minor.pre-release>` (#7335) ## Summary This PR adds support to include Python pre-releases when requesting versions. Check out the docs for commands that support the `Python` option: ```text --python, -p python The Python interpreter to use for the virtual environment. ``` At least the following scenarios are supported: ```bash 3.13.0a1 3.13b2 3.13rc4 313rc1 ``` ## Test Plan I added a basic unit test to `uv/crates/uv-python/src/discovery.rs`. I could have added more, but I have not discovered any relevant places. CI passes Note: I was unable to execute the entire test set locally. There were at least some timeout issues (some tests took over 60 seconds). ========== output =========== beta version ```bash cargo run -- venv --python 3.13.0b3 ░▒▓ 94% Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.20s Running `target/debug/uv venv --python 3.13.0b3` Using Python 3.13.0b3 interpreter at: /home/mikko/.pyenv/versions/3.13.0b3/bin/python3 Creating virtualenv at: .venv Activate with: source .venv/bin/activate ```` release candidate ```bash cargo run -- venv --python 3.13.0rc2 ░▒▓ 94% Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.83s Running `target/debug/uv venv --python 3.13.0rc2` Using Python 3.13.0rc2 interpreter at: /home/mikko/.pyenv/versions/3.13.0rc2/bin/python3 Creating virtualenv at: .venv Activate with: source .venv/bin/activate ``` ```bash cargo run -- venv --python 313rc2 ░▒▓ 94% Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.31s Running `target/debug/uv venv --python 313rc2` Using Python 3.13.0rc2 interpreter at: /home/mikko/.pyenv/versions/3.13.0rc2/bin/python3 Creating virtualenv at: .venv Activate with: source .venv/bin/activate ``` --------- Co-authored-by: Zanie Blue <contact@zanie.dev>
- Loading branch information