pixi-to-conda-lock converts a pixi.lock file to a conda-lock.yml file.
Project description
pixi-to-conda-lock
pixi-to-conda-lock is a Python utility designed to bridge the gap between the lightning-fast pixi lock and the traditionally slow generation of conda-lock files.
By converting your fast-generated pixi.lock file into a fully functional conda-lock.yml, you can enjoy rapid lock file creation without sacrificing the reproducibility of your conda environments.
Table of Contents
Features
- Speed Boost: Generate a
conda-lock.ymlfile quickly by leveraging the performance ofpixi lock. - Accurate Conversion: Uses repodata to extract detailed package metadata from your
pixi.lockfile. - Multi-Environment Support: Convert all environments in your pixi.lock file or select specific ones.
- Multi-Manager Support: Handles both conda and PyPI packages, ensuring comprehensive environment reproduction.
- Fully Tested: Comprehensive tests ensure robust and reliable behavior.
- Typed & Readable: Written in Python with full type annotations for clarity and maintainability.
Usage
Transform your fast-generated pixi.lock file into reproducible conda lock files with a single command:
pixi-to-conda-lock --help
This will display the help message:
usage: pixi-to-conda-lock [-h] [--output OUTPUT] [--environment ENVIRONMENT]
[--verbose]
pixi_lock
Convert pixi.lock to conda-lock.yml
positional arguments:
pixi_lock Path to pixi.lock file
options:
-h, --help show this help message and exit
--output, -o OUTPUT Output directory for conda-lock files (default:
current directory)
--environment, -e ENVIRONMENT
Specific environment to convert (default: convert all
environments)
--verbose, -v Enable verbose logging
Installation
Install pixi-to-conda-lock via PyPI:
pip install pixi-to-conda-lock
Or clone the repository and install locally:
git clone https://github.com/basnijholt/pixi-to-conda-lock.git
cd pixi-to-conda-lock
pip install .
Examples
Basic Conversion
Convert all environments in your pixi.lock file to conda-lock files:
pixi-to-conda-lock /path/to/pixi.lock
This will generate:
conda-lock.ymlfor the default environment<env_name>.conda-lock.ymlfor each additional environment
Converting a Specific Environment
Convert only a specific environment from your pixi.lock file:
pixi-to-conda-lock /path/to/pixi.lock --environment dev
This will generate only dev.conda-lock.yml (or conda-lock.yml if the environment is "default").
Specifying an Output Directory
Save the generated conda-lock files to a specific directory:
pixi-to-conda-lock /path/to/pixi.lock --output /path/to/output/dir
Enable Verbose Logging
To see detailed logs during the conversion process:
pixi-to-conda-lock /path/to/pixi.lock --verbose
How It Works
- Fast pixi.lock Parsing: Reads the fast-generated
pixi.lockfile, which is created quickly compared to generating a conda lock file directly. - Environment Detection: Identifies all environments defined in the pixi.lock file or processes only the specified environment.
- Repodata Loading: Retrieves detailed package metadata from repodata files (either automatically discovered or from a user-specified directory).
- Package Processing: Processes both conda and PyPI packages for each environment. For conda packages, if repodata information isn't available, the tool falls back on URL parsing.
- Generating conda-lock.yml: Combines the gathered information to generate fully reproducible conda-lock files that mirror your original environments.
This approach ensures you get the speed benefits of pixi lock without compromising on the quality and reproducibility of your conda environments.
Support and Contributions
Contributions, bug reports, and feature suggestions are welcome! Please open an issue or submit a pull request on the GitHub repository.
Happy converting!
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
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 pixi_to_conda_lock-0.4.1.tar.gz.
File metadata
- Download URL: pixi_to_conda_lock-0.4.1.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ad2f86bcd03068c2fab1722572c450bec68052082cd7e4f32fd609a5a0bb916
|
|
| MD5 |
ef52026680367ddc3739e48010d4935c
|
|
| BLAKE2b-256 |
be1ebf8656799b0d5856d0806df577a48c4d15c946aa235891c098cbf26c2840
|
Provenance
The following attestation bundles were made for pixi_to_conda_lock-0.4.1.tar.gz:
Publisher:
release.yml on basnijholt/pixi-to-conda-lock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pixi_to_conda_lock-0.4.1.tar.gz -
Subject digest:
9ad2f86bcd03068c2fab1722572c450bec68052082cd7e4f32fd609a5a0bb916 - Sigstore transparency entry: 818753433
- Sigstore integration time:
-
Permalink:
basnijholt/pixi-to-conda-lock@991ce33ec6197992094dd7ccb6ac1f783f037192 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/basnijholt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@991ce33ec6197992094dd7ccb6ac1f783f037192 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pixi_to_conda_lock-0.4.1-py3-none-any.whl.
File metadata
- Download URL: pixi_to_conda_lock-0.4.1-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd6bf435f5ede79eb2926ee52d1b8cec9c68ebc2765044493154860f61953903
|
|
| MD5 |
f261f85c890a0c84d25081d499611924
|
|
| BLAKE2b-256 |
3c90ca1634e232801252f7ee5308f1b3759bfa50b9409b0bfb6cf9c07cf17974
|
Provenance
The following attestation bundles were made for pixi_to_conda_lock-0.4.1-py3-none-any.whl:
Publisher:
release.yml on basnijholt/pixi-to-conda-lock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pixi_to_conda_lock-0.4.1-py3-none-any.whl -
Subject digest:
cd6bf435f5ede79eb2926ee52d1b8cec9c68ebc2765044493154860f61953903 - Sigstore transparency entry: 818753511
- Sigstore integration time:
-
Permalink:
basnijholt/pixi-to-conda-lock@991ce33ec6197992094dd7ccb6ac1f783f037192 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/basnijholt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@991ce33ec6197992094dd7ccb6ac1f783f037192 -
Trigger Event:
release
-
Statement type: