Skip to content

jorenretel/pixi-vendor-proof-of-concept

Repository files navigation

pixi-vendor

Warning

⚠️ PROOF OF CONCEPT CODE ⚠️

This is experimental proof-of-concept code. Do NOT use it for anything serious or in production environments.

A utility for creating portable archives of pixi environments with vendored PyPI dependencies.

Purpose

This tool addresses a gap in the current pixi ecosystem by allowing you to create self-contained ZIP archives that include non-public PyPI dependencies (VCS dependencies, path dependencies, and private packages). This is useful when you need to share or deploy pixi environments that contain dependencies not available on public PyPI.

Note: This is a temporary solution until official vendoring support is added to pixi itself.

What it does

  • Extracts non-public PyPI dependencies from pixi.lock files
  • Downloads or builds source distributions for these dependencies
  • Creates a ZIP archive containing the vendored dependencies alongside updated pixi.toml and pixi.lock files
  • Updates dependency paths to point to the vendored artifacts

Installation

git clone https://github.com/jorenretel/pixi-vendor-proof-of-concept.git
cd pixi-vendor-proof-of-concept
pip install -e .

Usage

Basic usage

# Create a vendored archive from the current directory
pixi-vendor create

# Specify custom paths
pixi-vendor create --lock path/to/pixi.lock --manifest path/to/pixi.toml --output my-env.zip

# Dry run to see what would be done
pixi-vendor create --dry-run

# Force rebuild even if archive exists
pixi-vendor create --force

Python API

from pixi_vendor import create

# Create vendored archive
archive_path = create(
    lock_path="pixi.lock",
    toml_path="pixi.toml",  # Optional, inferred if not provided
    output_path="my-env.zip",  # Optional, defaults to workspace-name-slim.zip
    dry_run=False
)

Example workflow

  1. Create the archive:

    cd my-pixi-project
    pixi-vendor create
  2. Extract and use elsewhere:

    unzip my-project-slim.zip -d /path/to/deployment
    cd /path/to/deployment
    pixi install

Supported dependency types

  • VCS dependencies: Git repositories, GitHub, GitLab, etc.
  • Path dependencies: Local packages with path = "..."
  • Direct URL dependencies: Private package servers

Regular PyPI packages are left as-is since they're publicly available.

Requirements

  • Python 3.11+
  • pixi project with pixi.lock file
  • Dependencies: pydantic

Limitations

  • Only handles PyPI dependencies (conda dependencies are not vendored)
  • Requires source distributions to be buildable
  • May need build tools installed (pip install build if auto-install fails)

Development

# Run tests
pixi run pytest

# Install in development mode
pip install -e .

License

Internal use only.

About

proof of concept for snapshots with pixi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages