auditwheel-like tool for Pyodide
Project description
auditwheel-emscripten
auditwheel-like tool for wheels targeting Emscripten platform
$ pip install auditwheel-emscripten
What is this?
auditwheel-emscripten is a tiny tool to facilitate the creation of Python wheel packages for Emscripten. auditwheel-emscripten is originally created for Pyodide, but it can be used in any other projects that target Python-in-the-browser using Emscripten.
pyodide auditwheel show: shows external shared libraries that the wheel depends on.pyodide auditwheel repair: copies these external shared libraries into the wheel itself, and update the RPATH of the WASM module correspondingly.
Usage (CLI)
Usage: pyodide auditwheel [OPTIONS] COMMAND [ARGS]...
Auditwheel-like tool for emscripten wheels and shared libraries.
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ copy [Deprecated] Copy shared libraries to the wheel directory. Works same as repair. Use repair instead. │
│ exports Show exports of a wheel or a shared library file. │
│ imports Show imports of a wheel or a shared library file. │
│ repair Repair a wheel file: copy shared libraries to the wheel directory. │
│ show Show shared library dependencies of a wheel or a shared library file. │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
$ pyodide auditwheel show shapely-2.0.7-cp313-cp313-pyodide_2025_0_wasm32.whl
shapely/speedups/_speedups.cpython-310-wasm32-emscripten.so:
libgeos_c.so
shapely/vectorized/_vectorized.cpython-310-wasm32-emscripten.so:
libgeos_c.so
$ pyodide auditwheel repair --libdir <directory which contains libgeos_c.so> shapely-2.0.7-cp313-cp313-pyodide_2025_0_wasm32.whl
shapely/lib.cpython-313-wasm32-emscripten.so:
libgeos_c.so => shapely.libs/libgeos_c.so
shapely/_geometry_helpers.cpython-313-wasm32-emscripten.so:
libgeos_c.so => shapely.libs/libgeos_c.so
shapely/_geos.cpython-313-wasm32-emscripten.so:
libgeos_c.so => shapely.libs/libgeos_c.so
shapely.libs/libgeos.so:
shapely.libs/libgeos_c.so:
libgeos.so => shapely.libs/libgeos.so
Usage (API)
Listing shared library dependencies of a wheel file:
from auditwheel_emscripten import show
libs = show("Shapely-1.8.2-cp310-cp310-emscripten_3_1_14_wasm32.whl")
print(libs)
# {'shapely/vectorized/_vectorized.cpython-310-wasm32-emscripten.so': ['libgeos_c.so'], 'shapely/speedups/_speedups.cpython-310-wasm32-emscripten.so': ['libgeos_c.so']}
Copying shared libraries to the wheel:
from auditwheel_emscripten import repair, show
repaired_wheel = repair(
"Shapely-1.8.2-cp310-cp310-emscripten_3_1_14_wasm32.whl",
libdir="/path/where/shared/libraries/are/located",
outdir="/path/to/output/directory",
)
libs = show(repaired_wheel)
print(libs)
# {'Shapely.libs/libgeos.so.3.10.3': [], 'Shapely.libs/libgeos_c.so': ['libgeos.so.3.10.3'], 'shapely/speedups/_speedups.cpython-310-wasm32-emscripten.so': ['libgeos_c.so'], 'shapely/vectorized/_vectorized.cpython-310-wasm32-emscripten.so': ['libgeos_c.so']}
Implementation details / limitations
Dynamic linking in Emscripten
Dynamic linking is not in the WebAssembly specification, but Emscripten has its own dynamic linking support, which is required for building Python wheels targeting Emscripten platform.
This tool is based on:
- Loosely documented Emscripten dynamic linking specification: https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md
- Emscripten's internal utility for inspecting WASM module: https://github.com/emscripten-core/emscripten/blob/main/tools/webassembly.py
- Emscripten dylink implementation: https://github.com/emscripten-core/emscripten/blob/main/src/library_dylink.js
auditwheel vs auditwheel-emscripten
auditwheel is a tool that helps repair and modify Python wheels (pre-compiled packages)
to be compatible with a wide range of Linux distributions.
It does this by copying external shared libraries into the wheel and
repairing the RPATH (a file path that is used to locate shared libraries at runtime)
of the ELF binary so that the Linux operating system can locate the library when the program is run.
auditwheel-emscripten is a variation of auditwheel that is specifically designed
to work with Emscripten-generated WebAssembly (WASM) modules.
It does not perform an audit on the wheel, as Emscripten does not guarantee compatibility between versions.
Instead, it simply copies the required libraries into the wheel without modifying the module itself.
It is up to the user to manually implement a way to locate these libraries at runtime.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file auditwheel_emscripten-0.2.3.tar.gz.
File metadata
- Download URL: auditwheel_emscripten-0.2.3.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
022a1526e549f9365aab5ca52402d54756c4ff57f0fd88f56548c329f91740b1
|
|
| MD5 |
15c776a7bdb4ee37217384343628d6fa
|
|
| BLAKE2b-256 |
b35afe0ba9a827d6ccfc33c86169f8cb1488d55e2e6de674d1d4e8589ac13ccd
|
Provenance
The following attestation bundles were made for auditwheel_emscripten-0.2.3.tar.gz:
Publisher:
deploy.yml on pyodide/auditwheel-emscripten
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auditwheel_emscripten-0.2.3.tar.gz -
Subject digest:
022a1526e549f9365aab5ca52402d54756c4ff57f0fd88f56548c329f91740b1 - Sigstore transparency entry: 904190680
- Sigstore integration time:
-
Permalink:
pyodide/auditwheel-emscripten@1ce55b6f34f1409a97a475152d253640b5773e93 -
Branch / Tag:
refs/tags/0.2.3 - Owner: https://github.com/pyodide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@1ce55b6f34f1409a97a475152d253640b5773e93 -
Trigger Event:
release
-
Statement type:
File details
Details for the file auditwheel_emscripten-0.2.3-py3-none-any.whl.
File metadata
- Download URL: auditwheel_emscripten-0.2.3-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
729a03cc28041e48282fac22e15aa5498594412c56a6d16b239b7c2c3dd0ad7b
|
|
| MD5 |
34c125e2d95897277eb50b8adcf09818
|
|
| BLAKE2b-256 |
4efe62e23a0c43ec8e57c6a36a2174f783215e444a4705a45028fff7f4ed5896
|
Provenance
The following attestation bundles were made for auditwheel_emscripten-0.2.3-py3-none-any.whl:
Publisher:
deploy.yml on pyodide/auditwheel-emscripten
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
auditwheel_emscripten-0.2.3-py3-none-any.whl -
Subject digest:
729a03cc28041e48282fac22e15aa5498594412c56a6d16b239b7c2c3dd0ad7b - Sigstore transparency entry: 904190729
- Sigstore integration time:
-
Permalink:
pyodide/auditwheel-emscripten@1ce55b6f34f1409a97a475152d253640b5773e93 -
Branch / Tag:
refs/tags/0.2.3 - Owner: https://github.com/pyodide
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@1ce55b6f34f1409a97a475152d253640b5773e93 -
Trigger Event:
release
-
Statement type: