Support different lockfiles in conda.
Project description
conda-lockfiles
Support for different lockfiles in the conda CLI tool.
[!IMPORTANT] This project is still in early stages of development. Don't use it in production (yet). We do welcome feedback on what the expected behaviour should have been if something doesn't work!
What is this?
conda-lockfiles adds support for additional lockfile formats to conda. It supports different types of lockfiles from the ecosystem like conda-lock or pixi.
A lockfile is a machine-generated file that records the exact versions and sources of every package
in a given environment, including all dependencies, in its fully-resolved state. Unlike with
environment.yml, requirements.txt, or similar files, lockfiles do not require the environment to be
solved again, which might introduce differences from the original environment. Lockfiles can reproduce
exact environments across different machines and points in time again and again.
The basic usage is:
# Create environment from lockfile
conda create --name ENV-NAME --format FORMAT --file /path/to/lockfile
# Export current environment to lockfile
conda export --name ENV-NAME --format FORMAT --file /path/to/lockfile
If conda recognizes your lockfile's format, the --format flag is optional with conda create.
Currently supported lockfile formats are:
conda-lock.yml/conda-lock.yaml—conda-lock-v1(alias:conda-lock)pixi.lock—rattler-lock-v6(aliases:pixi,pixi-lock-v6)
The version-pinned names (such as -v1, -v6) never change meaning. The short
aliases track the current-stable version. For information on when to use which name,
see format aliases.
Installation
conda-lockfiles is a conda plugin and must be installed in the base environment:
conda install --name base conda-forge::conda-lockfiles
Usage
Creating a lockfile for the current environment
conda export --format FORMAT --file FILE
To specify additional platforms:
conda export --format FORMAT --file FILE [--override-platforms] --platform PLATFORM ...
See conda export docs for more details.
Creating a new environment from a lockfile
conda create --file FILE
If conda is unable to determine the file format:
conda env create --file FILE --format FORMAT
See conda create docs for more details.
Examples
Export one conda-lock file with several platforms (adjust platforms to what you need; exporting a platform different than the host may fail):
conda export \
--name myenv \
--format conda-lock-v1 \
--file conda-lock.yml \
--platform linux-64 \
--platform osx-64
Create an environment from that lockfile:
conda create --name myenv --file conda-lock.yml
# if the format is not auto-detected:
conda create --name myenv --file dev-lock.yml --format conda-lock-v1
Pixi / rattler lock v6:
conda export --name myenv --format pixi --file pixi.lock
conda create --name myenv --file pixi.lock --format pixi
pixi resolves to rattler-lock-v6 today. Use --format rattler-lock-v6 in committed lockfiles
and CI so a future alias flip doesn't change the written format.
More information and example workflows are available on our online documentation.
Contributing
Please refer to CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file conda_lockfiles-0.2.0.tar.gz.
File metadata
- Download URL: conda_lockfiles-0.2.0.tar.gz
- Upload date:
- Size: 203.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e063121dfff28e659d7115594a3a03af698f75e490db49ce7aa4269a2c62ac3
|
|
| MD5 |
393487e063862ad1c1d9e2ce880a7656
|
|
| BLAKE2b-256 |
69a908b96e6e379d57252051ec4806a99a8444a104c7524236eec33e09e86e7c
|
Provenance
The following attestation bundles were made for conda_lockfiles-0.2.0.tar.gz:
Publisher:
pypi.yml on conda-incubator/conda-lockfiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
conda_lockfiles-0.2.0.tar.gz -
Subject digest:
2e063121dfff28e659d7115594a3a03af698f75e490db49ce7aa4269a2c62ac3 - Sigstore transparency entry: 1443585315
- Sigstore integration time:
-
Permalink:
conda-incubator/conda-lockfiles@376575e877e623f55dcc3e7439eff633c64eb44d -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/conda-incubator
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@376575e877e623f55dcc3e7439eff633c64eb44d -
Trigger Event:
release
-
Statement type:
File details
Details for the file conda_lockfiles-0.2.0-py3-none-any.whl.
File metadata
- Download URL: conda_lockfiles-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ce514815cfae912164027a7393be376f3982ec0973dd42fbef65854ea568cbc
|
|
| MD5 |
64d4ee4eba77a81ede2b2f8ccd17e2a8
|
|
| BLAKE2b-256 |
a21ffb5a6fd654e283d97dace824e3347710911e616dba4caaecf944da24f277
|
Provenance
The following attestation bundles were made for conda_lockfiles-0.2.0-py3-none-any.whl:
Publisher:
pypi.yml on conda-incubator/conda-lockfiles
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
conda_lockfiles-0.2.0-py3-none-any.whl -
Subject digest:
0ce514815cfae912164027a7393be376f3982ec0973dd42fbef65854ea568cbc - Sigstore transparency entry: 1443585396
- Sigstore integration time:
-
Permalink:
conda-incubator/conda-lockfiles@376575e877e623f55dcc3e7439eff633c64eb44d -
Branch / Tag:
refs/tags/0.2.0 - Owner: https://github.com/conda-incubator
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@376575e877e623f55dcc3e7439eff633c64eb44d -
Trigger Event:
release
-
Statement type: