[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

@ -202,6 +202,10 @@ impl PythonPath {
Self::SysPrefix(path.into(), SysPrefixPathOrigin::VirtualEnvVar)
}
pub fn from_conda_prefix_var(path: impl Into<SystemPathBuf>) -> Self {
Self::Resolve(path.into(), SysPrefixPathOrigin::CondaPrefixVar)
}
pub fn from_cli_flag(path: SystemPathBuf) -> Self {
Self::Resolve(path, SysPrefixPathOrigin::PythonCliFlag)
}