languages: Invoke conda activate in conda environments (#37627)

This isn't quite right, but using the env manager path causes conda to
scream and I am not yet sure why, either way this is an improvement over
the status quo

Release Notes:

- N/A\
This commit is contained in:
Lukas Wirth
2025-09-05 11:16:15 +00:00
committed by GitHub
parent bed358718b
commit ec58adca13
+7
View File
@@ -902,6 +902,13 @@ impl ToolchainLister for PythonToolchainProvider {
let env = toolchain.name.as_deref().unwrap_or("default");
activation_script.push(format!("pixi shell -e {env}"))
}
Some(PythonEnvironmentKind::Conda) => {
if let Some(name) = &toolchain.name {
activation_script.push(format!("conda activate {name}"));
} else {
activation_script.push("conda activate".to_string());
}
}
Some(PythonEnvironmentKind::Venv | PythonEnvironmentKind::VirtualEnv) => {
if let Some(prefix) = &toolchain.prefix {
let activate_keyword = match shell {