Skip to content

Add mamba support to language: conda#2207

Merged
asottile merged 1 commit intopre-commit:masterfrom
xhochy:mamba
Jan 15, 2022
Merged

Add mamba support to language: conda#2207
asottile merged 1 commit intopre-commit:masterfrom
xhochy:mamba

Conversation

@xhochy
Copy link
Contributor

@xhochy xhochy commented Jan 15, 2022

Fixes #2204

@xhochy xhochy marked this pull request as draft January 15, 2022 08:45
@xhochy
Copy link
Contributor Author

xhochy commented Jan 15, 2022

@janjagusch This is missing tests for the *mamba paths. My proposal would be to mock the output of shutil.which and check whether the right conda_exe is used depending on the environment variables set. I wouldn't install mamba / micromamba in CI as it isn't a responsibility of pre-commit to check whether their install commands are drop-ins. If they don't match, this is a bug in the tools themselves.

@asottile asottile marked this pull request as ready for review January 15, 2022 21:31
@asottile
Copy link
Member

I went ahead and adjusted this in a few ways and wrote tests:

  • if the user opts in via the environment variable don't fall back
  • treat any non-empty present variable as set (consistent with the rest of the project)

@asottile asottile merged commit 12b4823 into pre-commit:master Jan 15, 2022
@xhochy xhochy deleted the mamba branch January 16, 2022 13:29
@xhochy
Copy link
Contributor Author

xhochy commented Jan 16, 2022

Thanks @asottile !

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Allow to mamba install environments

2 participants