Skip to content

Commit 0f951b3

Browse files
committed
Add cli for use in NPM scripts
When used in NPM scripts, `setup-micromamba` provides a convenient way to download micromamba and create conda environments. Set options through environment variables in invocation. If micromamba has already been downloaded or an environment already exists, it will not be recreated. Example: ``` "scripts": { [...] "micromamba": "MICROMAMBA_ROOT_PATH=micromamba CREATE_ENVIRONMENT=true CREATE_ARGS=\"python=3.11\" ENVIRONMENT_NAME=test-env setup-micromamba", [...] ``` We re-use the mocking core. Determination of the core backend is moved to a separate module to prevent duplication and circular imports. The default micromamba bin path is set to `${MICROMAMBA_ROOT_PATH}/micromamba` if `MICROMAMBA_ROOT_PATH` is set. Have the mocking core respect the log level.
1 parent 8752438 commit 0f951b3

File tree

15 files changed

+89213
-4815
lines changed

15 files changed

+89213
-4815
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
GitHub Action to set up the [micromamba](https://github.com/mamba-org/mamba#micromamba) package manager.
66

7+
Also useful to download micromamba and create conda environments in npm
8+
scripts.
9+
710
## Usage
811

912
```yml
@@ -367,6 +370,24 @@ For further information, see
367370
[`jobs.<job_id>.steps[*].shell`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell)
368371
and [this thread](https://github.com/orgs/community/discussions/25061).
369372

373+
## Use in NPM scripts
374+
375+
When used in NPM scripts, `setup-micromamba` provides a convenient way to
376+
download micromamba and create conda environments.
377+
378+
Set options through environment variables in invocation. If micromamba has
379+
already been downloaded or an environment already exists, it will not be
380+
recreated.
381+
382+
Example:
383+
384+
```
385+
"scripts": {
386+
[...]
387+
"micromamba": "MICROMAMBA_ROOT_PATH=micromamba CREATE_ENVIRONMENT=true CREATE_ARGS=\"python=3.11\" ENVIRONMENT_NAME=test-env setup-micromamba",
388+
[...]
389+
```
390+
370391
## Development
371392

372393
1. Clone this repository.

0 commit comments

Comments
 (0)