Skip to main content

Pre-commit hook to sync a pixi environment with a traditional conda environment.yml

Project description

pixi-sync-environment

Test

A pre-commit hook and CLI tool that generates conda environment.yml files from pixi projects using pixi workspace export conda-environment. Useful for maintaining compatibility with conda-based workflows and CI systems that don't support pixi.

The tool compares the generated environment with an existing environment.yml file (if present) and updates it only when changes are detected. In check mode, it reports differences without modifying files.

Installation

pip install pixi-sync-environment

CLI Usage

# Sync pixi environment to environment.yml
pixi_sync_environment pixi.toml

# Sync a specific pixi environment
pixi_sync_environment --environment dev pixi.toml

# Check mode (exits with code 1 if out of sync)
pixi_sync_environment --check pixi.toml

Options

positional arguments:
  input_files                    Path to pixi.toml, pyproject.toml, environment.yml, or pixi.lock

options:
  --environment-file FILE        Output file name (default: environment.yml)
  --environment ENV              Pixi environment to export (default: default)
  --name NAME                    Environment name in output file
  --check                        Verify sync status without modifying files

Pre-commit Hook

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/binado/pixi-sync-environment
    rev: v0.3.0
    hooks:
      - id: pixi-sync-environment
        # args: [--environment, dev, --environment-file, environment-dev.yml]

For check-only validation (useful in CI):

repos:
  - repo: https://github.com/binado/pixi-sync-environment
    rev: v0.3.0
    hooks:
      - id: pixi-sync-check

License

MIT

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_sync_environment-0.3.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

pixi_sync_environment-0.3.1-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file pixi_sync_environment-0.3.1.tar.gz.

File metadata

  • Download URL: pixi_sync_environment-0.3.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pixi_sync_environment-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e5854fe82f66c938f755b2a4c1026127ced645f04538b3c16bb9047c06aef673
MD5 dca1c886c2122ffe842d2e0202ab30ca
BLAKE2b-256 30bd8d7856c588e5c01b85c24fa8746a9176dd92c8018ea07bd2fbe56bb2679b

See more details on using hashes here.

File details

Details for the file pixi_sync_environment-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pixi_sync_environment-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pixi_sync_environment-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f8ae7bb9caf7a45961e6e64fc4c317a4a8a8fad3baab5026930c850a8813100f
MD5 3ba1302e8654ac01461b73057702fc76
BLAKE2b-256 2829e1355c9af196a261b77c09bbd657043013da74fb54b01a22bf37831ab16d

See more details on using hashes here.

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