Skip to content

Commit 79d3a33

Browse files
committed
fix: venv check
1 parent 2bcf7bf commit 79d3a33

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

src/run/runner/valgrind/helpers/ignored_objects_path.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,9 @@ use crate::prelude::*;
22
use std::{path::PathBuf, process::Command};
33

44
fn find_venv_python_paths() -> anyhow::Result<Vec<String>> {
5-
let venv_path = std::env::var("VIRTUAL_ENV").ok();
6-
if venv_path.is_none() {
7-
return Ok(vec![]);
8-
}
9-
let venv_path = venv_path.unwrap();
10-
let python_path = PathBuf::from(venv_path).join("bin").join("python");
11-
if !python_path.exists() {
12-
return Ok(vec![]);
13-
}
14-
debug!("Found venv python path: {}", python_path.to_string_lossy());
15-
16-
// 'uv python find'
175
let output = Command::new("uv")
18-
.args(["python", "find", &python_path.to_string_lossy()])
6+
.args(["python", "find"])
7+
.current_dir(std::env::current_dir()?)
198
.output()?;
209
if !output.status.success() {
2110
bail!(
@@ -93,6 +82,8 @@ fn find_python_paths() -> anyhow::Result<Vec<String>> {
9382
let venv_paths = find_venv_python_paths().unwrap_or_default();
9483
debug!("venv python paths: {venv_paths:?}");
9584

85+
// For each python path, look at the folder to possibly identify more python versions
86+
9687
let mut paths = uv_paths;
9788
paths.extend(system_paths);
9889
paths.extend(venv_paths);

0 commit comments

Comments
 (0)