-
-
Notifications
You must be signed in to change notification settings - Fork 932
Description
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
| with clean_path_on_failure(env_dir): | |
| cmd_output_b( | |
| 'conda', 'env', 'create', '-p', env_dir, '--file', | |
| 'environment.yml', cwd=prefix.prefix_dir, | |
| ) |
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.