From 461141275768fa280c25623d3da056c3be904865 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 18 Sep 2024 10:19:10 -0500 Subject: [PATCH] Allow Python pre-releases to be used if they are first on the `PATH` (#7470) Closes https://github.com/astral-sh/uv/issues/7469 --- .github/workflows/ci.yml | 4 ++-- crates/uv-python/src/discovery.rs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd1a35005..75e6d8f26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1326,7 +1326,7 @@ jobs: run: echo $(which python) - name: "Validate global Python install" - run: py -3.13 ./scripts/check_system_python.py --uv ./uv.exe --python 3.13 + run: py -3.13 ./scripts/check_system_python.py --uv ./uv.exe system-test-choco: timeout-minutes: 10 @@ -1405,7 +1405,7 @@ jobs: run: echo $(which python3.13) - name: "Validate global Python install" - run: python3.13 scripts/check_system_python.py --uv ./uv --python 3.13 + run: python3.13 scripts/check_system_python.py --uv ./uv system-test-conda: timeout-minutes: 10 diff --git a/crates/uv-python/src/discovery.rs b/crates/uv-python/src/discovery.rs index 4ae3f702e..9ad49788c 100644 --- a/crates/uv-python/src/discovery.rs +++ b/crates/uv-python/src/discovery.rs @@ -1370,8 +1370,9 @@ impl PythonSource { /// Whether a pre-release Python installation from the source should be used without opt-in. pub(crate) fn allows_prereleases(self) -> bool { match self { - Self::Managed | Self::Registry | Self::SearchPath | Self::MicrosoftStore => false, - Self::CondaPrefix + Self::Managed | Self::Registry | Self::MicrosoftStore => false, + Self::SearchPath + | Self::CondaPrefix | Self::ProvidedPath | Self::ParentInterpreter | Self::ActiveEnvironment