conda-build and dependency resolution

Viewed 102

I have a conda based project, which has a few dependencies declared in meta.yaml. These dependencies of course have their own dependencies, which aren't listed in my meta.yaml. As a result, building my project with conda build sometimes results in different dependencies being used for a build.

I would like to specify all the dependencies in some kind of a lock file, so that every time I do conda build the same dependencies are used.

I've looked at conda-build docs, and found this section about reproducibility, but it doesn't really say how to create reproducible builds.

Is there any way to get conda build to use the same dependency tree every time it runs?

1 Answers

I think this command should do the trick:

conda env export -n <your-env-name> > env.yml

The yml will not only include a list of all the packages in your environment, but also their version numbers and a unique hash as an identifier to ensure reproducability.

Related