Skip to content

Commit 36ef264

Browse files
committed
logging
1 parent e858937 commit 36ef264

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

crates/pet-pyenv/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use std::{
1313

1414
use env_variables::EnvVariables;
1515
use environments::{get_generic_python_environment, get_virtual_env_environment};
16+
use log::trace;
1617
use manager::PyEnvInfo;
1718
use pet_conda::{utils::is_conda_env, CondaLocator};
1819
use pet_core::{
@@ -146,17 +147,23 @@ impl Locator for PyEnv {
146147
let manager = manager.clone();
147148
let path = path.clone();
148149
s.spawn(move || {
150+
trace!("Checking pyenv path: {:?}", path);
149151
if let Some(executable) = find_executable(&path) {
150152
if is_conda_env(&path) {
153+
trace!("Pyenv {:?} is a conda env", path);
151154
conda_locator.find_and_report(reporter, &path);
152155
} else if let Some(env) =
153156
get_virtual_env_environment(&executable, &path, &manager)
154157
{
158+
trace!("Pyenv {:?} is a virtualenv", path);
155159
reporter.report_environment(&env)
156160
} else if let Some(env) =
157161
get_generic_python_environment(&executable, &path, &manager)
158162
{
163+
trace!("Pyenv {:?} is a pyenv", path);
159164
reporter.report_environment(&env)
165+
} else {
166+
trace!("Pyenv {:?} is not a python env", path);
160167
}
161168
}
162169
});

crates/pet/tests/ci_test.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ fn check_if_pyenv_virtualenv_exists() {
226226
let environment = EnvironmentApi::new();
227227
let conda_locator = Arc::new(Conda::from(&environment));
228228
let poetry_locator = Arc::new(Poetry::from(&environment));
229-
229+
println!("START PYENV TEST");
230+
println!("START PYENV TEST");
231+
println!("START PYENV TEST");
230232
find_and_report_envs(
231233
&CacheReporter::new(reporter.clone()),
232234
Default::default(),
@@ -237,11 +239,6 @@ fn check_if_pyenv_virtualenv_exists() {
237239

238240
let environments = reporter.environments.lock().unwrap().clone();
239241
println!("PYENV TEST {:?}", environments);
240-
println!("PYENV TEST {:?}", environments);
241-
println!("PYENV TEST {:?}", environments);
242-
println!("PYENV TEST {:?}", environments);
243-
println!("PYENV TEST {:?}", environments);
244-
println!("{:?}", environments);
245242
assert!(
246243
environments.iter().any(
247244
|env| env.kind == Some(PythonEnvironmentKind::PyenvVirtualEnv)

0 commit comments

Comments
 (0)