Skip to main content

Build conda packages directly from pure python wheels

Project description

whl2conda logo

whl2conda


pypi version conda version documentation
PyPI - Python Version GitHub
CI codecov GitHub issues
Pixi Badge

Generate conda packages directly from pure python wheels

whl2conda is a command line utility to build and test conda packages generated directly from pure python wheels.

Background: See doc/about/motivation.md for the story behind this project.

  • Performance: because it does not need to create conda environments in order to build, this is much faster than solutions involving conda-build.

  • Dependency renaming: renames pypi package dependencies to their corresponding conda name. Automatically renames packages from known list collected from conda-forge and supports user-specified rename patterns as well.

  • Multiple package formats: can generate both V1 ('.tar.bz2') and V2 ('.conda') conda package formats. Can also generate an unpacked directory tree for debugging or additional user customization.

  • Project configuration: whl2conda project-specific options can be read from project's pyproject.toml file.

  • Test install support: supports installing conda package into a conda environment for testing prior to deployment.

  • Hides pypi dependencies: rewrites the original pip/pypi dependencies in the installed dist-info to avoid compatibility issues.

  • Binary wheel support: can convert non-pure Python wheels containing binary extensions (.so, .pyd) into platform-specific conda packages using the --allow-impure flag. Automatically generates tight Python version pins and OS constraints from wheel platform tags, with special support for stable ABI (abi3) and multi-platform (fat) wheels. Conversions of representative C, C++, Cython, rust, and abi3 extension packages are regularly verified to be equivalent to the corresponding conda-forge packages on linux, macOS, and windows.

    Limitations: Binary conversion is designed for self-contained extension packages (e.g., markupsafe, cryptography, orjson). Wheels that bundle vendored shared libraries (e.g., lxml, pillow) convert with a warning but bypass conda's dependency management for those libraries, and wheels with local version suffixes (e.g., +cu121 variant builds) are refused. For complex GPU/CUDA packages, use conda-forge packages instead.

Installation

With pip:

pip install whl2conda

With conda (upcoming):

conda install -c conda-forge whl2conda

Quick usage

Generate a conda package in same directory as wheel file:

whl2conda convert dist/mypackage-1.2.3-py3-none-any.whl

Add default tool options to pyproject.toml

whl2conda config --generate-pyproject pyproject.toml

Build both wheel and conda package for project:

whl2conda convert --build-wheel my-project-root

Create python 3.10 test environment for generated conda package:

whl2conda install dist/mypackage-1.2.3.-py_0.conda --create -n testenv \
  --extra pytest python=3.10

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

whl2conda-26.7.1.tar.gz (83.4 kB view details)

Uploaded Source

Built Distribution

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

whl2conda-26.7.1-py3-none-any.whl (97.9 kB view details)

Uploaded Python 3

File details

Details for the file whl2conda-26.7.1.tar.gz.

File metadata

  • Download URL: whl2conda-26.7.1.tar.gz
  • Upload date:
  • Size: 83.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for whl2conda-26.7.1.tar.gz
Algorithm Hash digest
SHA256 044e295abdd89296e912075b88946f58cae5211f15ec7233f914701aa6d27a9b
MD5 474ed26058a6aaff1dfd9afbe662df7e
BLAKE2b-256 fb5030106b8574898eafe80903caaf51a0ad59ca3ee4fcdbf153d5df4bd9e679

See more details on using hashes here.

Provenance

The following attestation bundles were made for whl2conda-26.7.1.tar.gz:

Publisher: release.yml on zuzukin/whl2conda

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

File details

Details for the file whl2conda-26.7.1-py3-none-any.whl.

File metadata

  • Download URL: whl2conda-26.7.1-py3-none-any.whl
  • Upload date:
  • Size: 97.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for whl2conda-26.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2db82f36dc337eb840c2244157362e74a50a212f30cc5d6f8e2b15041054172e
MD5 aa167f4a064c8b4c5211c33cacf9f3e8
BLAKE2b-256 627a932df11a9f734c99ef9353cd853b3ada24ccee4d41ffe0d446ea9f35d05a

See more details on using hashes here.

Provenance

The following attestation bundles were made for whl2conda-26.7.1-py3-none-any.whl:

Publisher: release.yml on zuzukin/whl2conda

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