Remove PythonPreference toggle based on UV_TEST_PYTHON_PATH (#7989)
Needed for https://github.com/astral-sh/uv/pull/7934 This is some legacy logic, I think.
This commit is contained in:
@@ -328,7 +328,7 @@ fn python_executables_from_installed<'a>(
|
||||
})
|
||||
.flatten();
|
||||
|
||||
let from_windows = std::iter::once_with(move || {
|
||||
let from_windows_registry = std::iter::once_with(move || {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
// Skip interpreter probing if we already know the version doesn't match.
|
||||
@@ -376,14 +376,14 @@ fn python_executables_from_installed<'a>(
|
||||
PythonPreference::Managed => Box::new(
|
||||
from_managed_installations
|
||||
.chain(from_search_path)
|
||||
.chain(from_windows),
|
||||
.chain(from_windows_registry),
|
||||
),
|
||||
PythonPreference::System => Box::new(
|
||||
from_search_path
|
||||
.chain(from_windows)
|
||||
.chain(from_windows_registry)
|
||||
.chain(from_managed_installations),
|
||||
),
|
||||
PythonPreference::OnlySystem => Box::new(from_search_path.chain(from_windows)),
|
||||
PythonPreference::OnlySystem => Box::new(from_search_path.chain(from_windows_registry)),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1522,15 +1522,6 @@ impl PythonPreference {
|
||||
}
|
||||
}
|
||||
|
||||
/// Return the default [`PythonPreference`], respecting the `UV_TEST_PYTHON_PATH` variable.
|
||||
pub fn default_from_env() -> Self {
|
||||
if env::var_os("UV_TEST_PYTHON_PATH").is_some() {
|
||||
Self::OnlySystem
|
||||
} else {
|
||||
Self::default()
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn allows_managed(self) -> bool {
|
||||
matches!(self, Self::Managed | Self::OnlyManaged)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user