@@ -75,8 +75,10 @@ fn verify_validity_of_discovered_envs() {
7575 let environment = EnvironmentApi :: new ( ) ;
7676 let conda_locator = Arc :: new ( Conda :: from ( & environment) ) ;
7777 let poetry_locator = Arc :: new ( Poetry :: from ( & environment) ) ;
78- let mut config = Configuration :: default ( ) ;
79- config. workspace_directories = Some ( vec ! [ workspace_dir. clone( ) ] ) ;
78+ let config = Configuration {
79+ workspace_directories : Some ( vec ! [ workspace_dir. clone( ) ] ) ,
80+ ..Default :: default ( )
81+ } ;
8082 let locators = create_locators ( conda_locator. clone ( ) , poetry_locator. clone ( ) , & environment) ;
8183 for locator in locators. iter ( ) {
8284 locator. configure ( & config) ;
@@ -283,19 +285,16 @@ fn verify_validity_of_interpreter_info(environment: PythonEnvironment) {
283285 }
284286 }
285287 if let Some ( prefix) = environment. clone ( ) . prefix {
286- if interpreter_info. clone ( ) . executable == "/usr/local/python/current/bin/python"
288+ if ( interpreter_info. clone ( ) . executable == "/usr/local/python/current/bin/python"
287289 && ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/current"
288290 && interpreter_info. clone ( ) . sys_prefix == "/usr/local/python/3.10.13" )
289291 || ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/3.10.13"
290- && interpreter_info. clone ( ) . sys_prefix == "/usr/local/python/current" )
291- {
292- // known issue https://github.com/microsoft/python-environment-tools/issues/64
293- } else if interpreter_info. clone ( ) . executable
294- == "/home/codespace/.python/current/bin/python"
295- && ( prefix. to_str ( ) . unwrap ( ) == "/home/codespace/.python/current"
296- && interpreter_info. clone ( ) . sys_prefix == "/usr/local/python/3.10.13" )
297- || ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/3.10.13"
298- && interpreter_info. clone ( ) . sys_prefix == "/home/codespace/.python/current" )
292+ && interpreter_info. clone ( ) . sys_prefix == "/usr/local/python/current" ) )
293+ || ( interpreter_info. clone ( ) . executable == "/home/codespace/.python/current/bin/python"
294+ && ( prefix. to_str ( ) . unwrap ( ) == "/home/codespace/.python/current"
295+ && interpreter_info. clone ( ) . sys_prefix == "/usr/local/python/3.10.13" )
296+ || ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/3.10.13"
297+ && interpreter_info. clone ( ) . sys_prefix == "/home/codespace/.python/current" ) )
299298 {
300299 // known issue https://github.com/microsoft/python-environment-tools/issues/64
301300 } else {
@@ -487,20 +486,19 @@ fn compare_environments(actual: PythonEnvironment, expected: PythonEnvironment,
487486 actual. version = expected. clone ( ) . version ;
488487
489488 if let Some ( prefix) = expected. clone ( ) . prefix {
490- if actual. clone ( ) . executable == Some ( PathBuf :: from ( "/usr/local/python/current/bin/python" ) )
489+ if ( actual. clone ( ) . executable
490+ == Some ( PathBuf :: from ( "/usr/local/python/current/bin/python" ) )
491491 && ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/current"
492492 && actual. clone ( ) . prefix == Some ( PathBuf :: from ( "/usr/local/python/3.10.13" ) ) )
493493 || ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/3.10.13"
494- && actual. clone ( ) . prefix == Some ( PathBuf :: from ( "/usr/local/python/current" ) ) )
495- {
496- // known issue https://github.com/microsoft/python-environment-tools/issues/64
497- actual. prefix = expected. clone ( ) . prefix ;
498- } else if actual. clone ( ) . executable
499- == Some ( PathBuf :: from ( "/home/codespace/.python/current/bin/python" ) )
500- && ( prefix. to_str ( ) . unwrap ( ) == "/home/codespace/.python/current"
501- && actual. clone ( ) . prefix == Some ( PathBuf :: from ( "/usr/local/python/3.10.13" ) ) )
502- || ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/3.10.13"
503- && actual. clone ( ) . prefix == Some ( PathBuf :: from ( "/home/codespace/.python/current" ) ) )
494+ && actual. clone ( ) . prefix == Some ( PathBuf :: from ( "/usr/local/python/current" ) ) ) )
495+ || ( actual. clone ( ) . executable
496+ == Some ( PathBuf :: from ( "/home/codespace/.python/current/bin/python" ) )
497+ && ( prefix. to_str ( ) . unwrap ( ) == "/home/codespace/.python/current"
498+ && actual. clone ( ) . prefix == Some ( PathBuf :: from ( "/usr/local/python/3.10.13" ) ) )
499+ || ( prefix. to_str ( ) . unwrap ( ) == "/usr/local/python/3.10.13"
500+ && actual. clone ( ) . prefix
501+ == Some ( PathBuf :: from ( "/home/codespace/.python/current" ) ) ) )
504502 {
505503 // known issue https://github.com/microsoft/python-environment-tools/issues/64
506504 actual. prefix = expected. clone ( ) . prefix ;
@@ -591,8 +589,10 @@ fn verify_we_can_get_same_env_info_using_resolve_with_exe(
591589 let os_environment = EnvironmentApi :: new ( ) ;
592590 let conda_locator = Arc :: new ( Conda :: from ( & os_environment) ) ;
593591 let poetry_locator = Arc :: new ( Poetry :: from ( & os_environment) ) ;
594- let mut config = Configuration :: default ( ) ;
595- config. workspace_directories = Some ( vec ! [ workspace_dir. clone( ) ] ) ;
592+ let config = Configuration {
593+ workspace_directories : Some ( vec ! [ workspace_dir. clone( ) ] ) ,
594+ ..Default :: default ( )
595+ } ;
596596 let locators = create_locators (
597597 conda_locator. clone ( ) ,
598598 poetry_locator. clone ( ) ,
@@ -720,13 +720,13 @@ fn get_python_run_command(env: &PythonEnvironment) -> Vec<String> {
720720 "python" . to_string( ) ,
721721 ]
722722 } else if let Some ( prefix) = env. prefix . clone ( ) {
723- return vec ! [
723+ vec ! [
724724 conda_exe,
725725 "run" . to_string( ) ,
726726 "-p" . to_string( ) ,
727727 prefix. to_str( ) . unwrap_or_default( ) . to_string( ) ,
728728 "python" . to_string( ) ,
729- ] ;
729+ ]
730730 } else {
731731 panic ! ( "Conda environment without name or prefix" )
732732 }
@@ -741,8 +741,8 @@ fn get_python_run_command(env: &PythonEnvironment) -> Vec<String> {
741741 }
742742}
743743
744- fn get_python_interpreter_info ( cli : & Vec < String > ) -> InterpreterInfo {
745- let mut cli = cli. clone ( ) ;
744+ fn get_python_interpreter_info ( cli : & [ String ] ) -> InterpreterInfo {
745+ let mut cli = cli. to_owned ( ) ;
746746 cli. push (
747747 resolve_test_path ( & [ "interpreterInfo.py" ] )
748748 . to_str ( )
0 commit comments