Allow for venv activation script to use pyenv
(#33119)
Release Notes: - Allows for configuration and use of `pyenv` as a virtual environment provider
This commit is contained in:
parent
bd78f2c493
commit
0671a4d5ae
2 changed files with 33 additions and 17 deletions
|
@ -95,12 +95,14 @@ pub enum VenvSettings {
|
|||
/// to the current working directory. We recommend overriding this
|
||||
/// in your project's settings, rather than globally.
|
||||
activate_script: Option<ActivateScript>,
|
||||
venv_name: Option<String>,
|
||||
directories: Option<Vec<PathBuf>>,
|
||||
},
|
||||
}
|
||||
|
||||
pub struct VenvSettingsContent<'a> {
|
||||
pub activate_script: ActivateScript,
|
||||
pub venv_name: &'a str,
|
||||
pub directories: &'a [PathBuf],
|
||||
}
|
||||
|
||||
|
@ -110,9 +112,11 @@ impl VenvSettings {
|
|||
VenvSettings::Off => None,
|
||||
VenvSettings::On {
|
||||
activate_script,
|
||||
venv_name,
|
||||
directories,
|
||||
} => Some(VenvSettingsContent {
|
||||
activate_script: activate_script.unwrap_or(ActivateScript::Default),
|
||||
venv_name: venv_name.as_deref().unwrap_or(""),
|
||||
directories: directories.as_deref().unwrap_or(&[]),
|
||||
}),
|
||||
}
|
||||
|
@ -128,6 +132,7 @@ pub enum ActivateScript {
|
|||
Fish,
|
||||
Nushell,
|
||||
PowerShell,
|
||||
Pyenv,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue