[ty] Resolving Python path using CONDA_PREFIX variable to support Conda and Pixi (#18267)

This commit is contained in:
lipefree 2025-05-23 20:00:42 +02:00 committed by GitHub
parent a1399656c9
commit 53d19f8368
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 89 additions and 1 deletions

View file

@ -186,6 +186,11 @@ impl Options {
.ok()
.map(PythonPath::from_virtual_env_var)
})
.or_else(|| {
std::env::var("CONDA_PREFIX")
.ok()
.map(PythonPath::from_conda_prefix_var)
})
.unwrap_or_else(|| PythonPath::Discover(project_root.to_path_buf())),
}
}