@@ -18,7 +18,6 @@ use uv_pep440::{
1818 LowerBound , Prerelease , UpperBound , Version , VersionSpecifier , VersionSpecifiers ,
1919 release_specifiers_to_ranges,
2020} ;
21- use uv_preview:: Preview ;
2221use uv_static:: EnvVars ;
2322use uv_warnings:: { warn_user_once, write_warning_chain} ;
2423use which:: { which, which_all} ;
@@ -308,9 +307,8 @@ impl uv_errors::Hint for Error {
308307/// - Discovered virtual environment (e.g. `.venv` in a parent directory)
309308///
310309/// Notably, "system" environments are excluded. See [`python_executables_from_installed`].
311- fn python_executables_from_virtual_environments < ' a > (
312- preview : Preview ,
313- ) -> impl Iterator < Item = Result < ( PythonSource , PathBuf ) , Error > > + ' a {
310+ fn python_executables_from_virtual_environments < ' a > ( )
311+ -> impl Iterator < Item = Result < ( PythonSource , PathBuf ) , Error > > + ' a {
314312 let from_active_environment = iter:: once_with ( || {
315313 virtualenv_from_env ( )
316314 . into_iter ( )
@@ -321,7 +319,7 @@ fn python_executables_from_virtual_environments<'a>(
321319
322320 // N.B. we prefer the conda environment over discovered virtual environments
323321 let from_conda_environment = iter:: once_with ( move || {
324- conda_environment_from_env ( CondaEnvironmentKind :: Child , preview )
322+ conda_environment_from_env ( CondaEnvironmentKind :: Child )
325323 . into_iter ( )
326324 . map ( virtualenv_python_executable)
327325 . map ( |path| Ok ( ( PythonSource :: CondaPrefix , path) ) )
@@ -536,7 +534,6 @@ fn python_executables<'a>(
536534 platform : PlatformRequest ,
537535 environments : EnvironmentPreference ,
538536 preference : PythonPreference ,
539- preview : Preview ,
540537) -> Box < dyn Iterator < Item = Result < ( PythonSource , PathBuf ) , Error > > + ' a > {
541538 // Always read from `UV_INTERNAL__PARENT_INTERPRETER` — it could be a system interpreter
542539 let from_parent_interpreter = iter:: once_with ( || {
@@ -548,14 +545,14 @@ fn python_executables<'a>(
548545
549546 // Check if the base conda environment is active
550547 let from_base_conda_environment = iter:: once_with ( move || {
551- conda_environment_from_env ( CondaEnvironmentKind :: Base , preview )
548+ conda_environment_from_env ( CondaEnvironmentKind :: Base )
552549 . into_iter ( )
553550 . map ( virtualenv_python_executable)
554551 . map ( |path| Ok ( ( PythonSource :: BaseCondaPrefix , path) ) )
555552 } )
556553 . flatten ( ) ;
557554
558- let from_virtual_environments = python_executables_from_virtual_environments ( preview ) ;
555+ let from_virtual_environments = python_executables_from_virtual_environments ( ) ;
559556 let from_installed =
560557 python_executables_from_installed ( version, implementation, platform, preference) ;
561558
@@ -757,23 +754,16 @@ fn python_installations<'a>(
757754 environments : EnvironmentPreference ,
758755 preference : PythonPreference ,
759756 cache : & ' a Cache ,
760- preview : Preview ,
761757) -> impl Iterator < Item = Result < PythonInstallation , Error > > + ' a {
762758 let installations = python_installations_from_executables (
763759 // Perform filtering on the discovered executables based on their source. This avoids
764760 // unnecessary interpreter queries, which are generally expensive. We'll filter again
765761 // with `interpreter_satisfies_environment_preference` after querying.
766- python_executables (
767- version,
768- implementation,
769- platform,
770- environments,
771- preference,
772- preview,
773- )
774- . filter_ok ( move |( source, path) | {
775- source_satisfies_environment_preference ( * source, path, environments)
776- } ) ,
762+ python_executables ( version, implementation, platform, environments, preference) . filter_ok (
763+ move |( source, path) | {
764+ source_satisfies_environment_preference ( * source, path, environments)
765+ } ,
766+ ) ,
777767 cache,
778768 )
779769 . filter_ok ( move |installation| {
@@ -1044,7 +1034,6 @@ pub fn find_python_installations<'a>(
10441034 environments : EnvironmentPreference ,
10451035 preference : PythonPreference ,
10461036 cache : & ' a Cache ,
1047- preview : Preview ,
10481037) -> Box < dyn Iterator < Item = Result < FindPythonResult , Error > > + ' a > {
10491038 let sources = DiscoveryPreferences {
10501039 python_preference : preference,
@@ -1136,7 +1125,6 @@ pub fn find_python_installations<'a>(
11361125 environments,
11371126 preference,
11381127 cache,
1139- preview,
11401128 )
11411129 . map_ok ( Ok )
11421130 } ) ,
@@ -1149,7 +1137,6 @@ pub fn find_python_installations<'a>(
11491137 environments,
11501138 preference,
11511139 cache,
1152- preview,
11531140 )
11541141 . map_ok ( Ok )
11551142 } ) ,
@@ -1166,7 +1153,6 @@ pub fn find_python_installations<'a>(
11661153 environments,
11671154 preference,
11681155 cache,
1169- preview,
11701156 )
11711157 . map_ok ( Ok )
11721158 } )
@@ -1180,7 +1166,6 @@ pub fn find_python_installations<'a>(
11801166 environments,
11811167 preference,
11821168 cache,
1183- preview,
11841169 )
11851170 . filter_ok ( |installation| implementation. matches_interpreter ( & installation. interpreter ) )
11861171 . map_ok ( Ok )
@@ -1198,7 +1183,6 @@ pub fn find_python_installations<'a>(
11981183 environments,
11991184 preference,
12001185 cache,
1201- preview,
12021186 )
12031187 . filter_ok ( |installation| {
12041188 implementation. matches_interpreter ( & installation. interpreter )
@@ -1222,7 +1206,6 @@ pub fn find_python_installations<'a>(
12221206 environments,
12231207 preference,
12241208 cache,
1225- preview,
12261209 )
12271210 . filter_ok ( move |installation| {
12281211 request. satisfied_by_interpreter ( & installation. interpreter )
@@ -1242,10 +1225,8 @@ pub(crate) fn find_python_installation(
12421225 environments : EnvironmentPreference ,
12431226 preference : PythonPreference ,
12441227 cache : & Cache ,
1245- preview : Preview ,
12461228) -> Result < FindPythonResult , Error > {
1247- let installations =
1248- find_python_installations ( request, environments, preference, cache, preview) ;
1229+ let installations = find_python_installations ( request, environments, preference, cache) ;
12491230 let mut first_prerelease = None ;
12501231 let mut first_debug = None ;
12511232 let mut first_managed = None ;
@@ -1403,7 +1384,6 @@ pub(crate) async fn find_best_python_installation(
14031384 python_install_mirror : Option < & str > ,
14041385 pypy_install_mirror : Option < & str > ,
14051386 python_downloads_json_url : Option < & str > ,
1406- preview : Preview ,
14071387) -> Result < PythonInstallation , crate :: Error > {
14081388 debug ! ( "Starting Python discovery for {request}" ) ;
14091389 let original_request = request;
@@ -1438,7 +1418,7 @@ pub(crate) async fn find_best_python_installation(
14381418 String :: new( )
14391419 }
14401420 ) ;
1441- let result = find_python_installation ( request, environments, preference, cache, preview ) ;
1421+ let result = find_python_installation ( request, environments, preference, cache) ;
14421422 let error = match result {
14431423 Ok ( Ok ( installation) ) => {
14441424 warn_on_unsupported_python ( installation. interpreter ( ) ) ;
0 commit comments