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.

  • 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.1.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.1-py3-none-any.whl (80.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for whl2conda-26.2.1.tar.gz
Algorithm Hash digest
SHA256 a429fc274fe7aed24d1b2dc2d3710ca3dea4c8cd1f2d7fb75ffaa146aa66e79d
MD5 1b190599170e3fc051fecc9fd8c00d44
BLAKE2b-256 3b654af6af6785f3184cbb9378f8998290278734056e29c8e4935da136042182

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: whl2conda-26.2.1-py3-none-any.whl
  • Upload date:
  • Size: 80.6 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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ee00d57d1acf4a99f4b6cc9c2636836da0994266ab5562d4522987056700ac3
MD5 fe0ac69f29df11a8d6cdcaecc4f4fc30
BLAKE2b-256 dc7355a6b4f219638f5c9170c1711f43036d61b4f1ea971510c4c78d077c0f63

See more details on using hashes here.

Provenance

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