@@ -6,7 +6,7 @@ use crate::{
6
6
package:: { CondaPackageInfo , Package } ,
7
7
utils:: { is_conda_env, is_conda_install} ,
8
8
} ;
9
- use log:: warn;
9
+ use log:: { trace , warn} ;
10
10
use pet_core:: {
11
11
arch:: Architecture ,
12
12
manager:: EnvManager ,
@@ -76,20 +76,30 @@ pub fn get_conda_environment_info(
76
76
return None ;
77
77
}
78
78
// If we know the conda install folder, then we can use it.
79
- let mut conda_install_folder = match manager {
80
- Some ( manager) => manager. conda_dir . clone ( ) ,
81
- None => get_conda_installation_used_to_create_conda_env ( env_path) ,
82
- } ;
79
+ let mut conda_install_folder = manager
80
+ . clone ( )
81
+ . and_then ( |m| m. conda_dir )
82
+ . or_else ( || get_conda_installation_used_to_create_conda_env ( env_path) ) ;
83
+
83
84
if let Some ( conda_dir) = & conda_install_folder {
84
- if !conda_dir. exists ( ) {
85
+ if conda_dir. exists ( ) {
86
+ trace ! (
87
+ "Conda install folder {}, found, & will not be used for the Conda Env: {}" ,
88
+ env_path. display( ) ,
89
+ conda_dir. display( )
90
+ ) ;
91
+ } else {
85
92
warn ! (
86
93
"Conda install folder {}, does not exist, hence will not be used for the Conda Env: {}" ,
87
94
env_path. display( ) ,
88
95
conda_dir. display( )
89
96
) ;
90
97
conda_install_folder = None ;
91
98
}
99
+ } else {
100
+ trace ! ( "Conda install folder not found for {}" , env_path. display( ) ) ;
92
101
}
102
+
93
103
if let Some ( python_binary) = find_executable ( env_path) {
94
104
if let Some ( package_info) = CondaPackageInfo :: from ( env_path, & Package :: Python ) {
95
105
Some ( CondaEnvironment {
0 commit comments