Skip to content

Commit 159451f

Browse files
Exclude Pixi environments from the Conda locator (#234)
Should fix microsoft/vscode-python-environments#654 This uses the same technique employed by the `pet-pixi` crate. cc @eleanorjboyd
1 parent 4fef717 commit 159451f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/pet-conda/src/utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ pub fn is_conda_install(path: &Path) -> bool {
3232

3333
/// conda-meta must exist as this contains a mandatory `history` file.
3434
/// The root conda installation folder is also a conda environment (its the base environment).
35+
/// Exclude Pixi environments to avoid misidentifying them as conda environments.
3536
pub fn is_conda_env(path: &Path) -> bool {
36-
path.join("conda-meta").is_dir()
37+
path.join("conda-meta").is_dir() && !path.join("conda-meta").join("pixi").is_file()
3738
}
3839

3940
/// Only used in tests, noop in production.

0 commit comments

Comments
 (0)