whl2conda convert¶
Usage¶
Generates a conda package from a python wheel
Input options¶
[<wheel> | <project-root>]
Either path to a wheel file to convert or a project root
directory containing a pyproject.toml or setup.py file.
--project-root <dir>, --root <dir>
Project root directory. This is a directory containing either a
pyproject.toml or a (deprecated) setup.py file. This option may
not be used if the project directory was given as the positional
argument.
If not specified, the project root will be located by searching
the wheel directory and its parent directories, or if no wheel
given, will default to the current directory.
--from-pypi <package-spec>
Download package satisfying <package-spec> from standard pypi.org repository.
--from-index <index-url> <package-spec>
Download package satisfying <package-spec> from repository at <index-url>.
-w <dir>, --wheel-dir <dir>
Location of wheel directory. Defaults to dist/ subdirectory of
project.
--ignore-pyproject
Ignore settings from pyproject.toml file, if any
--update-stdrenames, --no-update-stdrenames
Whether to update list of standard pypi to conda renames from internet.
Default from settings: False (default: False)
--allow-metadata-version <version>
Allow specified (unsupported) metadata version in input wheel files.
Output options¶
--out-dir <dir>, --out <dir>
Output directory for conda package. Defaults to wheel directory
or else project dist directory.
--overwrite
Overwrite existing output files.
--format {V1,tar.bz2,V2,conda,tree}, --out-format {V1,tar.bz2,V2,conda,tree}
Output package format (None)
--build-wheel
Build wheel
--build-number BUILD_NUMBER
Specify build number. Otherwise taken from wheel.
Override options¶
--name <package-name>
Override package name
-R <pip-name> <conda-name>, --dependency-rename <pip-name> <conda-name>
Rename pip dependency for conda. May be specified multiple times.
-A <conda-dep>, --add-dependency <conda-dep>
Add an additional conda dependency. May be specified multiple times.
-D <pip-name>, --drop-dependency <pip-name>
Drop dependency with given name from conda dependency list.
May be specified multiple times.
--known-extras
Replace dependencies with known extras by their corresponding
conda packages, e.g. `uvicorn[standard]` by `uvicorn-standard`.
--resolve-extras
Resolve dependency extras not otherwise handled by reading
package metadata from pypi.org (requires network access).
The extra's dependencies are taken from the newest release
satisfying the dependency's version spec, so this is a
best-effort approximation.
-K, --keep-pip-dependencies
Retain pip dependencies in python dist_info of conda package.
--python <version-spec>
Set/override python dependency.
Binary conversion options¶
--allow-impure
Allow conversion of non-pure python wheels containing
binary extensions into platform-specific conda packages.
Generates tight Python version pins and OS constraints from wheel
tags. Stable ABI (abi3) wheels are only pinned to a minimum python
version. Use --python to override the generated python dependency.
--for-conda-forge, --for-cpython
When converting a stable ABI (abi3) wheel, also add the CEP-20
python pins used by conda-forge: 'cpython' (excludes PyPy) and
'_python_abi3_support' (excludes free-threaded builds). These
packages only exist on the conda-forge channel, so do not use
this option for packages targeting channels without them.
--platform-tag <tag>
Wheel platform tag to convert for, when converting a
multi-platform ("fat") binary wheel that supports several
(e.g. 'macosx_10_15_x86_64'). By default, the platform
matching the current system is preferred.
--all-platforms
Generate a conda package for every platform supported by
the wheel, each written into a <subdir>/ subdirectory of
the output directory (e.g. osx-arm64/).
--download-platform <tag>
Target platform tag for download (e.g. 'manylinux2014_x86_64',
'macosx_11_0_arm64', 'win_amd64'). Used with --from-pypi or
--from-index to download a platform-specific binary wheel.
Implies --allow-impure.
--download-python-version <ver>
Target Python version for download (e.g. '3.12').
Used with --from-pypi or --from-index.
--download-abi <tag>
Target ABI tag for download (e.g. 'cp312').
Used with --from-pypi or --from-index.