Skip to main content

Lockfiles for conda

Project description

conda-lock

Conda lock is a lightweight library that can be used to generate fully reproducible lock files for conda environments.

It does this by performing multiple solves for conda targeting a set of platforms you desire lockfiles for.

This also has the added benefit of acting as an external presolve for conda as the lockfiles it generates results in the conda solver not being invoked when installing the packages from the generated lockfile.

why?

Conda environment.yaml files are very useful for defining desired environments but there are times when we want to be able to EXACTLY reproduce an environment by just installing and downloading the packages needed.

This is particularly handy in the context of a gitops style setup where you use conda to provision environments in various places

Dockerfile example

In order to use conda-lock in a docker-style context you want to add the lockfile to the docker container. In order to refresh the lock file just run conda-lock again.

  Dockerfile
  environment.yaml
* conda-linux-64.lock
# Dockerfile

# Build container
FROM continuumio/miniconda:latest as conda

ADD conda-linux-64.lock /locks/conda-linux-64.lock
RUN conda create -p /opt/env --copy --file /locks/conda-linux-64.lock

# Primary container

FROM gcr.io/distroless/base-debian10

COPY --from=conda /opt/env /opt/env

installation

pip install conda-lock

usage

# generate the lockfiles
conda-lock -f environment.yml -p osx-64 -p linux-64

# create an environment from the lockfile
conda-lock install [-p {prefix}|-n {name}] conda-linux-64.lock

# alternatively, use conda command directly
conda create -n my-locked-env --file conda-linux-64.lock

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

conda_lock-0.7.3.tar.gz (49.0 kB view details)

Uploaded Source

Built Distribution

conda_lock-0.7.3-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file conda_lock-0.7.3.tar.gz.

File metadata

  • Download URL: conda_lock-0.7.3.tar.gz
  • Upload date:
  • Size: 49.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6

File hashes

Hashes for conda_lock-0.7.3.tar.gz
Algorithm Hash digest
SHA256 dc06cbb91519557f0e81a39c58b2bcc4f3e8dd2622ee4ba05fd95182229089d8
MD5 5b20bbb9388471cd16fa4c0d9edbfb3e
BLAKE2b-256 bf6aa4b7720cd36fabfbaef63acc12b1f2f6f318a4a53e1b8f535b9bcadc8bd7

See more details on using hashes here.

Provenance

File details

Details for the file conda_lock-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: conda_lock-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.6

File hashes

Hashes for conda_lock-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c8e78d5b94fe5e94bbb499cd7f3490cdce934e78af5f09fdfb8f6b6266c4132d
MD5 183761e25b238c7e10e32cfec2b7c6d8
BLAKE2b-256 12672b1931be3d5c9ec3836bd00020805ae4dad75030855851eea1c01c757b7b

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page