Skip to main content

pixi-to-conda-lock converts a pixi.lock file to a conda-lock.yml file.

Project description

pixi-to-conda-lock 🔄🔒

Build Coverage GitHub Stars PyPI License Downloads Open Issues

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. 🚀

[ToC] 📚

:star2: Features

  • Speed Boost: Generate a conda-lock.yml file quickly by leveraging the performance of pixi lock.
  • Accurate Conversion: Uses repodata to extract detailed package metadata from your pixi.lock file.
  • 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.

:books: 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]
                          [--repodata-dir REPODATA_DIR] [--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)
  --repodata-dir REPODATA_DIR
                        Path to repodata cache directory
  --verbose, -v         Enable verbose logging

:hammer_and_wrench: 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 .

:bulb: 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.yml for the default environment
  • <env_name>.conda-lock.yml for 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

Specifying a Repodata Directory

If you have a custom repodata cache directory:

pixi-to-conda-lock /path/to/pixi.lock --repodata-dir /custom/path/to/repodata

Enable Verbose Logging

To see detailed logs during the conversion process:

pixi-to-conda-lock /path/to/pixi.lock --verbose

:page_facing_up: How It Works

  1. Fast pixi.lock Parsing: Reads the fast-generated pixi.lock file, which is created quickly compared to generating a conda lock file directly.
  2. Environment Detection: Identifies all environments defined in the pixi.lock file or processes only the specified environment.
  3. Repodata Loading: Retrieves detailed package metadata from repodata files (either automatically discovered or from a user-specified directory).
  4. 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.
  5. 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.


:heart: 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

pixi_to_conda_lock-0.2.0.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pixi_to_conda_lock-0.2.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file pixi_to_conda_lock-0.2.0.tar.gz.

File metadata

  • Download URL: pixi_to_conda_lock-0.2.0.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pixi_to_conda_lock-0.2.0.tar.gz
Algorithm Hash digest
SHA256 06ad285cfbd7da8c42bb8ff96541628265e0c95a1db166de823e65439be63fbd
MD5 821814c6e0ecc5dc4565184a30f00e11
BLAKE2b-256 26382a590fb4d8d5d1cd39772faef308593edbefc73f4b57618c546f6263b7d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pixi_to_conda_lock-0.2.0.tar.gz:

Publisher: release.yml on basnijholt/pixi-to-conda-lock

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pixi_to_conda_lock-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pixi_to_conda_lock-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34fa4aaac0b00e47c1ab9c418948a834f1994a2af602faca47801ab0f00e886f
MD5 c4674f3e5fc94126b0417551bc75850d
BLAKE2b-256 9f1ce28ecd505d1cca580cb793df1571799cbef7d70b21ac254283e0ff0dac1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pixi_to_conda_lock-0.2.0-py3-none-any.whl:

Publisher: release.yml on basnijholt/pixi-to-conda-lock

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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