Skip to content

Support conda lock files (from conda-lock) #7772

@humitos

Description

@humitos

We received a request to support conda lock files:

Instead of supporting conda-lock, would it be possible to install an environment using lock files? For instance, would it be possible to add an additional (optional) field to the configuration asking if the provided yaml file is a lock file ? If the flag is set then conda/mamba would use

conda create --file environment.yml -n env_name

and if not set,

conda env create -f environment.yml -n env_name

The default value can be set to False to maintain backwards compatibility.

Typically lock files are created by users and checked-in to version control for reproducibility. So if someone already has the lock file generated, it would make the RTD build job a lot easier (both conda/mamba) to just install the requirements from the lock file. This would also reduce the resource usage on the build server and improve the speed and stability of the build process.

conda-lock was mentioned in #6815 (comment) but when I tried it calling conda-lock -f ... failed. However, it seems that we don't need to depend on that conda-lock, but the user just need to use the lock file generated by that command as an environment.yml file. If the only change required to support conda lock files is just to remove env from that command and change -f by --file, we could create a feature flag for now that we can apply to these projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions