Skip to main content

Self-contained wheels for Windows

Project description

CI PyPI version Python versions

delvewheel

delvewheel is a command-line tool for creating Python wheel packages for Windows that have DLL dependencies that may not be present on the target system. It is functionally similar to auditwheel (for Linux) and delocate (for Mac OS).

Suppose that you have built a Python wheel for Windows containing an extension module, but the wheel depends on DLLs that are present in the build environment but may not be present on the end user's machine. This tool determines which DLLs a wheel depends on (aside from system libraries) and copies those DLLs into the wheel.

Installation

delvewheel can be installed using pip.

pip install delvewheel

You can also install from the source code by opening a command-line shell at the repository root and running

pip install .

Python 3.6+ on Windows is required.

Usage

delvewheel show: show external DLLs that the wheel depends on

delvewheel repair: copy external DLL dependencies into the wheel and patch the wheel so that these libraries are loaded at runtime

delvewheel needed: list the direct DLL dependencies of a single executable

delvewheel searches for the location of DLL dependencies in the following order.

  1. The PATH environment variable.
  2. The Visual C++ 14.x runtime redistributable directory, if it exists.

To specify an additional directory to search for DLLs, add the location of the DLL to the PATH environment variable or use the --add-path option.

For a summary of additional command-line options, use the -h option (delvewheel -h, delvewheel show -h, delvewheel repair -h, delvewheel needed -h).

Additional Options

delvewheel show

  • --add-path: additional path(s) to search for DLLs, semicolon delimited. These paths are searched before those in the PATH environment variable.
  • --add-dll: name(s) of additional DLL(s) to vendor into the wheel, semicolon delimited. We do not automatically search for dependencies of these DLLs.
  • --no-dll: name(s) of DLL(s) to specifically exclude from the wheel, semicolon delimited. Dependencies of these DLLs are also automatically excluded if no other included DLL depends on them.
  • --ignore-in-wheel: don't search for or vendor in DLLs that are already in the wheel. We still search for and vendor in dependencies of these DLLs if they are not in the wheel. This flag is meant for simpler integration with other DLL bundling tools/techniques.
  • -v: verbose mode
  • --extract-dir: directory to store extracted contents of wheel for debug use (default is a temp directory)

delvewheel repair

  • --add-path: additional path(s) to search for DLLs, semicolon delimited. These paths are searched before those in the PATH environment variable.
  • --add-dll: name(s) of additional DLL(s) to vendor into the wheel, semicolon delimited. We do not automatically search for or vendor in dependencies of these DLLs, nor do we mangle the names of these DLLs.
  • --no-dll: name(s) of DLL(s) to specifically exclude from the wheel, semicolon delimited. Dependencies of these DLLs are also automatically excluded if no other included DLL depends on them.
  • --ignore-in-wheel: don't search for or vendor in DLLs that are already in the wheel. We still search for and vendor in dependencies of these DLLs if they are not in the wheel. This flag is meant for simpler integration with other DLL bundling tools/techniques.
  • -v: verbose mode
  • --extract-dir: directory to store extracted contents of wheel for debug use (default is a temp directory)
  • -w,--wheel-dir: directory to write the repaired wheel (default is wheelhouse relative to current working directory)
  • --no-mangle: name(s) of DLL(s) not to mangle, semicolon-delimited
  • --no-mangle-all: don't mangle any DLL names
  • -L,--lib-sdir: subdirectory suffix in package to store vendored DLLs (default .libs)

Limitations

  • delvewheel reads DLL file headers to determine which libraries a wheel depends on. DLLs that are loaded at runtime using ctypes/cffi (from Python) or LoadLibrary (from C/C++) will be missed. You can, however, specify additional DLLs to vendor into the wheel using the --add-dll option.
  • Wheels created using delvewheel are not guaranteed to work on systems older than Windows 7. If you intend to create a wheel for an old Windows system, you should test the resultant wheel thoroughly. If it turns out that getting the wheel to work on an older system simply requires an extra DLL, you can use the --add-dll flag to vendor additional DLLs into the wheel.
  • To avoid DLL hell, we mangle the file names of most DLLs that are vendored into the wheel. This way, a Python process that tries loading a vendored DLL does not end up using a different DLL with the same name. Due to a limitation in the machomachomangler dependency, delvewheel is unable to name-mangle DLLs containing extra data at the end of the binary. If your DLL was created with MinGW, you can use the strip utility to remove the extra data. Otherwise, use the --no-mangle flag.
  • The bitness of the Python interpreter that runs delvewheel must match the bitness of the wheel that is repaired. For example, you cannot run delvewheel from a 32-bit Python interpreter to repair a wheel that is meant for 64-bit Python.

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

delvewheel-0.0.16.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

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

delvewheel-0.0.16-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file delvewheel-0.0.16.tar.gz.

File metadata

  • Download URL: delvewheel-0.0.16.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for delvewheel-0.0.16.tar.gz
Algorithm Hash digest
SHA256 664ac211199037df34b73608cb36151744e9847d71f518dc3e5af5587585d2a7
MD5 3eefc3a063e7a522041ae80915a1330b
BLAKE2b-256 0e0ea7e8548c5c94e298aca2eff39c4cfab105a20740b8458a812a0e423fd711

See more details on using hashes here.

File details

Details for the file delvewheel-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: delvewheel-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for delvewheel-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 0d17d01ca5ca6fea5e879130370d85142b8af17ab9101cb2bdac45755de0eb0f
MD5 bf9c22625e7dbffb082fd749f3a547ea
BLAKE2b-256 6c2fe06b077e4b04c89217d2c442d621d7930fe0f0401494fb975db3f9676a33

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