Skip to content

Conversation

@jaimergp
Copy link

Trying to add support for mamba envs. Closes #962.

Should mamba be part of the tool autodiscovery mechanism specified in pythons? It's not clear to me how one can prioritize the env type here.

@jaimergp
Copy link
Author

Btw, this might not be needed at all if one sets an environment variable CONDA_EXE with value $(which mamba).

@jaimergp
Copy link
Author

No clue why this test is failing here. It does pass locally on my Mac 🤷

@saraedum
Copy link
Contributor

saraedum commented Dec 15, 2021

Btw, this might not be needed at all if one sets an environment variable CONDA_EXE with value $(which mamba).

This does not work for me. It seems that it's trying to $CONDA_EXE shell.posix which does not work yet in mamba afaik.

   usage: mamba [-h] [-V] command ...
   mamba: error: argument command: invalid choice: 'shell.posix' (choose from 'clean', 'compare', 'config', 'create', 'help', 'info', 'init', 'install', 'list', 'package', 'remove', 'uninstall', 'run', 'search', 'update', 'upgrade', 'repoquery')

   CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.

@saraedum
Copy link
Contributor

saraedum commented Dec 15, 2021

This works for me. On Linux at least:

$ cat conda-mamba.sh
#!/bin/bash

case $1 in
  activate|shell.posix)
    exec conda $@
    ;;
  *)
    exec mamba $@
    ;;
esac
$ chmod +x conda-mamba.sh
$ CONDA_EXE=`pwd`/conda-mamba.sh asv run

@datapythonista
Copy link
Member

Thanks for the contribution @jaimergp. I proposed to drop support for asv environments in #1031. In the meantime, I think supporting mamba sounds great, but I wonder if your approach here can be simplified, as per your comment about CONDA_EXE. Personally, I'd have a single plugin for both mamba and conda, default to mamba if it exists, as conda seems mostly unusable due to the solver nowadays, and let the user be explicit about which to use with the CONDA_EXE environment variable.

Does this make sense to you? Do you want to update this PR with this?

@datapythonista
Copy link
Member

We'll move torwards removing environment support, so not worth adding mamba. See #1031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to use mamba instead of conda for environment creation

3 participants