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
Allow to mamba install
environments
#2204
Comments
if it's drop in presumably you could |
Thanks @janjagusch for opening this issue. I also thought already about opening one here. There are some open points why I didn't yet make one here:
Normally, I have implemented this via the pseudocode in other tools:
An alternative in pre-commit could also be to implement it as another language, e.g. if you want to use |
After sleeping a night over this, I think we should not implement a new language as this will be confusing to the end-user. All three tools are package managers for the same distribution technique and only differ in speed and how they handle things like environment activation. There is no behavioural difference for pre-commit hooks, thus there also shouldn't be a difference in how things are configured. I opted for the ordering of first checking for |
If it is any consolation, the conda project has been working in the past months on porting the mamba solver to conda which should help with the most memory and cpu consuming parts of the installation. We'll do an opt-in release in a month or so. |
Thanks for the info @jezdez ! Would be great if that solves the enormous memory consumption of conda. |
Thanks for maintaining pre-commit, we really enjoying working with it!
When installing conda environments, mamba is often the preferred option, as it is faster and requires less memory when solving an environment.
As of today, pre-commit uses conda for creating environments, as this is hard-coded into the source code:
pre-commit/pre_commit/languages/conda.py
Lines 62 to 66 in b944395
We have a use case, where we want to install pre-commit hooks in CI, but the installation fails because of out-of-memory errors. Installing the same environment with mamba however, succeeds.
It would be nice if one could define whether pre-commit uses conda or mamba for installing environments. This could for example be accomplished by introducing an environment variable
PRE_COMMIT_USE_MAMBA
. If there is a better way to pass such configuration to pre-commit, please let me know.I'd be glad to work on this feature, if this is something you'd like to see added to pre-commit.
The text was updated successfully, but these errors were encountered: