Skip to main content

Build conda packages directly from pure python wheels

Project description

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.

  • 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 a 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.

  • Experimental binary 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.

    Limitations: Binary conversion works best for simple C extension packages (e.g., markupsafe, wrapt, ujson) where the wheel is self-contained. It will refuse to convert packages known to bundle complex runtime libraries (PyTorch, TensorFlow, CUDA packages, etc.) or wheels with local version suffixes (e.g., +cu121). 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.2.0.tar.gz (67.3 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.2.0-py3-none-any.whl (80.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: whl2conda-26.2.0.tar.gz
  • Upload date:
  • Size: 67.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for whl2conda-26.2.0.tar.gz
Algorithm Hash digest
SHA256 d7b33bf501c1d8f80ce171dc26df4f7220cc5abce2a71bdc22e46e0d0de83587
MD5 9a741374b2385d6d3e99cdc493364cc5
BLAKE2b-256 9b81e83383e86f0f9ce1b8bd2eec0cc928e0633770e609e2352b9213a776f8db

See more details on using hashes here.

File details

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

File metadata

  • Download URL: whl2conda-26.2.0-py3-none-any.whl
  • Upload date:
  • Size: 80.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for whl2conda-26.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36084c02d788a6ca1fbd6a6460cb7f5bdb2469fea723679a7414823e40889188
MD5 ba9c181b213d6aac8ff6f12bfd383368
BLAKE2b-256 bcd372d92ac4a0a1429cf14b56c56b0ef00e8a69bdbe8046252d8fcd1562e59b

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