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

conda: support for Mamba #444

Closed
henryiii opened this issue Jun 10, 2021 · 4 comments · Fixed by #448
Closed

conda: support for Mamba #444

henryiii opened this issue Jun 10, 2021 · 4 comments · Fixed by #448

Comments

@henryiii
Copy link
Collaborator

henryiii commented Jun 10, 2021

How would this feature be useful?

It would be great to support mamba, which is a conda replacement solver that is dramatically faster. A solve of a complex package like ROOT (which is a reason to use conda in the first place) takes several minutes with conda, and a few seconds with mamba.

Describe the solution you'd like

Option 1: Provide a new backend: "mamba". This would simply make conda_install(...) use mamba instead of conda. This is the best option I could think of.

Option 2: Automatically use mamba if available over conda. This is slightly too magical, and there are minute difference in the solve (that shouldn't matter).

Option 3: Add a setting to select the command used for conda. I don't think there is a good reason to generalize too much - mamba is a drop-in replacement for part of conda (other parts can just use conda, as it's always available with mamba).

This was mentioned in #346 (comment) as a side note, but never attempted.

@theacodes
Copy link
Collaborator

I'm all for having a mamba backend in addition to the conda one. I don't think we should automatically switch to mamba if it's available, since it doesn't completely support all of conda's options and can differ behaviorally - I wouldn't want to break the principle of least surprise.

FYI for my future self or others unfamiliar: this is the mamba project's documentation: https://mamba.readthedocs.io/en/latest/

Side note for this issue: what about having a channel= keyword argument for conda_install so that one could write channel="conda-forge" if selecting a channel? It would be a bit more natural than "--channel=conda-forge", I think, and likely is very common.

Probably makes sense to make a separate issue for this.

@henryiii
Copy link
Collaborator Author

Implementation idea: Make "conda" a class property on CondaEnv, then make a subclass of CondaEnv called MambaEnv that just sets this class property to "mamba" instead.

@henryiii
Copy link
Collaborator Author

Ahh, never mind, looking at the usage, it could easily just be a regular argument / instance variable, I think.

The only question remaining is, would the "mamba" backend require mamba to be installed, or should it try to install mamba with conda if mamba is not installed? The first one (requiring it to be preinstalled) would be fine with me for a first iteration, and it could be extended later to install mamba if you wanted to add that?

@henryiii henryiii changed the title Support for Mamba conda: support for Mamba Jun 11, 2021
@henryiii
Copy link
Collaborator Author

Xref: Mentioned as a side note in #346

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

Successfully merging a pull request may close this issue.

2 participants