File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ jobs:
133133 if : startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
134134 run : |
135135 pyenv install --list
136- pyenv install 3.12.4 3.8.19
136+ pyenv install 3.12.5 3.8.19
137137 shell : bash
138138
139139 # pyenv-win install list has not updated for a while
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ use pet_core::{
1212 Locator ,
1313} ;
1414use pet_env_var_path:: get_search_paths_from_env_variables;
15- use pet_python_utils:: env:: ResolvedPythonEnv ;
15+ use pet_python_utils:: { env:: ResolvedPythonEnv , executable :: find_executable } ;
1616
1717use crate :: locators:: identify_python_environment_using_locators;
1818
@@ -27,6 +27,17 @@ pub fn resolve_environment(
2727 locators : & Arc < Vec < Arc < dyn Locator > > > ,
2828 os_environment : & dyn Environment ,
2929) -> Option < ResolvedEnvironment > {
30+ // First check if executable is actually a file or a path.
31+ let mut executable = executable. to_owned ( ) ;
32+ if executable. is_dir ( ) {
33+ executable = match find_executable ( & executable) {
34+ Some ( exe) => exe,
35+ None => {
36+ warn ! ( "Could not find Python executable in {:?}" , executable) ;
37+ executable
38+ }
39+ } ;
40+ }
3041 // First check if this is a known environment
3142 let env = PythonEnv :: new ( executable. to_owned ( ) , None , None ) ;
3243 let global_env_search_paths: Vec < PathBuf > = get_search_paths_from_env_variables ( os_environment) ;
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ fn verify_python_in_homebrew_contaner() {
5050 let python3_12 = PythonEnvironment {
5151 kind : Some ( PythonEnvironmentKind :: Homebrew ) ,
5252 executable : Some ( PathBuf :: from ( "/home/linuxbrew/.linuxbrew/bin/python3" ) ) ,
53- version : Some ( "3.12.4 " . to_string ( ) ) , // This can change on CI, so we don't check it
53+ version : Some ( "3.12.5 " . to_string ( ) ) , // This can change on CI, so we don't check it
5454 symlinks : Some ( vec ! [
5555 PathBuf :: from( "/home/linuxbrew/.linuxbrew/bin/python3" ) ,
5656 PathBuf :: from( "/home/linuxbrew/.linuxbrew/bin/python3.12" ) ,
@@ -61,7 +61,7 @@ fn verify_python_in_homebrew_contaner() {
6161 PathBuf :: from( "/home/linuxbrew/.linuxbrew/opt/python@3.12/bin/python3" ) ,
6262 PathBuf :: from( "/home/linuxbrew/.linuxbrew/opt/python@3.12/bin/python3.12" ) ,
6363 // On CI the Python version can change with minor updates, so we don't check the full version.
64- // PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.12/3.12.4 /bin/python3.12"),
64+ // PathBuf::from("/home/linuxbrew/.linuxbrew/Cellar/python@3.12/3.12.5 /bin/python3.12"),
6565 ] ) ,
6666 ..Default :: default ( )
6767 } ;
You can’t perform that action at this time.
0 commit comments