Skip to content

Conversation

@thewtex
Copy link

@thewtex thewtex commented Oct 30, 2023

When used in NPM scripts, setup-micromamba provides a convenient way to download micromamba and create conda environments.

Set options through environment variables or command line flags in invocation. Command line flag parsing is very basic. 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",
  [...]

or

  "scripts": {
  [...]
    "micromamba": "setup-micromamba --micromamba-root-path micromamba --create-environment true --create-args \"python=3.11\" --environment-name test-env",
  [...]

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 micro mamba bin path is set to
${MICROMAMBA_ROOT_PATH}/micromamba if MICROMAMBA_ROOT_PATH is set.

Have the mocking core respect the log level.

@thewtex thewtex requested a review from pavelzw as a code owner October 30, 2023 18:01
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.
And running passing argument other that a shell script.
Example:

  setup-micromamba --micromamba-root-path micromamba debug --init-shell none --create-environment true --environment-file environment.yml --generate-run-shell true --micromamba-run-shell-path ./micromamba/run-shell --log-level debug
Separate run() invocations in src/main.ts and src/operations.ts.
In an NPM run script.

Todo: verify that this is not set in GitHub Actions.
Results in an error in GitHub Actions:

```
Error: Unable to process command '  ::add-path::<the path>
Error: The `add-path` command is disabled. Please upgrade to using
Environment Files or opt into unsecure command execution by setting the
`ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For
more information see:
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
```
@jjerphan
Copy link
Member

I am closing this issue since it is out of date, feel free to reopen / rebase it if you are still interested in contributing.

@jjerphan jjerphan closed this Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants