1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-30 13:47:46 +00:00
nu_scripts/modules/virtual_environments
KyQiao 6fe7713322
change match to case-insensitive (#1128)
`micromamba 2.1.1` change the output of `micromamba info` to lower case.
Change the match to case-insensitive to make it work on version `2.1.1`
2025-06-05 06:29:09 -05:00
..
auto-venv Fixed sys usage (#916) 2024-07-24 09:09:31 -05:00
nu_conda Fixed sys usage (#916) 2024-07-24 09:09:31 -05:00
nu_conda_2 change match to case-insensitive (#1128) 2025-06-05 06:29:09 -05:00
nu_msvs Prepend INCLUDE env, instead of override (#1127) 2025-06-02 19:10:20 -05:00
conda.nu conda activate should expand $env.PATH to a connection of absolute paths (#998) 2024-12-18 21:50:31 -06:00
README.md use $env. instead of let-env (#543) 2023-07-01 10:40:16 +02:00
venv.nu Port before v0.60/virtual_environments (#849) 2024-05-26 12:38:00 -05:00

Virtual environment scripts

The scripts in this directory activate virtual environments for Conda environments.

Usage

The activation and deactivation commands are exported from the conda module.

> use conda.nu
> conda activate foo
[foo] > conda deactivate
>

The activate command also includes custom completions for the environment names. To disable the prompt changes (e.g., to let Starship include its own), set the environment variable CONDA_NO_PROMPT. To set it globally, add the line $env.CONDA_NO_PROMPT = true to $nu.config-path.

Limitations

(old text, not tested)

  • The "root_prefix" might not actually correspond to the correct path to the Conda envs. You can fix this for your setup by changing how the root prefix is found in the conda-env command.
  • Nested envs are not well supported. If you activate a Conda env while another one is activated, new elements will be appended to the PATH, but the other environment variables will be overwritten. There's no way to then restore the PATH to the state it was in before activating the first env (at least not with this script directly).