Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Micromamba support #800

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions modules/virtual_environments/nu_conda_2/conda.nu
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ def --env load-conda-info-env [] {
if (not (has-env CONDA_INFO)) {
export-env {
$env.CONDA_INFO = (
if not (which mamba | is-empty) {
if not (which micromamba | is-empty) {
mut info = micromamba env list --json | from json
let extra_info = micromamba info --json | from json
$info.envs_dirs = $extra_info."envs directories"
$info.root_prefix = $extra_info."base environment"
$info
} else if not (which mamba | is-empty) {
(mamba info --envs --json --no-banner | from json)
} else if not (which conda | is-empty) {
(conda info --envs --json | from json)
Expand All @@ -21,7 +27,7 @@ export def --env activate [
load-conda-info-env
let conda_info = $env.CONDA_INFO
if ($conda_info == null) {
print "Error: No Conda or Mamba install could be found in the environment. Please install either and add them to the environment. See: https://www.nushell.sh/book/environment.html for more info"
print "Error: No Conda, Mamba or Micromamba install could be found in the environment. Please install either and add them to the environment. See: https://www.nushell.sh/book/environment.html for more info"
return
}

Expand Down Expand Up @@ -173,4 +179,4 @@ def system-path [] {

def has-env [name: string] {
$name in $env
}
}