setup-miniconda
setup-miniconda copied to clipboard
Generate environment from explicit conda lock file
Hey guys, is the setup tool able to generate a conda env straight from an explicit conda lock file by any chance? I tried it here and it complains. Cheers muchly for your help! :beer:
Thoughts on this @bollwyvl ?
cheers @goanpeca :beer: I managed to find a workaround for this (but it's not elegant) - I tell setup I want this env activated but I don't provide an actual env file, only to create the env from the lockfile inside my workflow. It works and all my dependencies are inside the env created from the lock file. But yeah, it's a way around it :grin:
sorry, I forgot to link the GA test and workflow
I thought we had this here: https://github.com/conda-incubator/setup-miniconda#example-7-lockfiles
Here's an aggressive example: https://github.com/robots-from-jupyter/robotframework-jupyterlibrary/blob/master/.github/workflows/ci.yml#L173
To use with a matrix, i pre-calculate the lockfile so it's available to be referenced in a number of places.
@jaimergp - hitting this with the example from https://github.com/conda-incubator/setup-miniconda#example-7-lockfiles:
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
activate-environment: explicit-env
environment-file: conda-lock.yml
conda-lock.yml
was generated with conda-lock -f environment.yml -p osx-64
I can reproduce this locally, so it's unclear whether this is a problem with the setup-miniconda
action:
$ conda env update --file conda-lock.yml
EnvironmentSectionNotValid: The following sections on '.../conda-lock.yml' are invalid and will be ignored:
- metadata
- package
- version
The returncode is zero, fwiw.
I've attached the conda-lock.yml for reference. conda-lock.yml
Conda-lock introduced a new default format, not supported by conda. Use --kind=explicit to get the old behavior.
The new format IS supported natively in micromamba though
@mariusvniekerk - hmm, what am I doing wrong?
$ mamba env update --file conda-lock.yml
EnvironmentSectionNotValid: The following sections on '.../conda-lock.yml' are invalid and will be ignored:
- metadata
- package
- version