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.0.tar.gz (80.1 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.0-py3-none-any.whl (94.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: whl2conda-26.7.0.tar.gz
  • Upload date:
  • Size: 80.1 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.0.tar.gz
Algorithm Hash digest
SHA256 1789ea98b787c5a689d3793da61a1e1cbb7f02c20df19b4b5848a8011c8d048c
MD5 6c885dab3411d9303d944ae2337d8b4b
BLAKE2b-256 ed30d41502a76a9f83e86e729cc6e14a12e316e1fa5882234d9fa8bcc96365ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for whl2conda-26.7.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: whl2conda-26.7.0-py3-none-any.whl
  • Upload date:
  • Size: 94.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9289099964c21911b132618e254f0cffebe398421d08b6888d7686d10ddcb29b
MD5 54cf79d62767c11c239b6fca458bed3b
BLAKE2b-256 74b28ff411f0bf7024baf6151bea5fe39754518b008b362fca5d7b77dce27515

See more details on using hashes here.

Provenance

The following attestation bundles were made for whl2conda-26.7.0-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