Skip to main content

Emscripten compatible build script for CPython C extensions

Project description

WasmPy-Build

This tool can compile CPython C extension files, such as the ones created by Cython, to WebAssembly so that the extensions are platform independent.

The created .wasm files can be imported by WasmPy in a simmilar manner to native C extensions.

This project contains modified CPython header files as well as a build script to ease the creation of .wasm extension files.

Currently this project only supports CPython 3.8, 3.9 and 3.10 but I'm hoping to add support for older versions.

Installation

To install WasmPy-Build you will first need to install the Emscripten SDK.

Install WasmPy-Build from pip

$ pip install wasmpy-build

... or build from source

$ git clone --recurse-submodules https://github.com/olivi-r/wasmpy-build
$ cd wasmpy-build
$ python -m pip install -r requirements.txt
$ python patch_headers.py
$ python setup.py install

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

wasmpy-build-0.2.1.tar.gz (761.0 kB view hashes)

Uploaded Source

Built Distribution

wasmpy_build-0.2.1-py3-none-any.whl (995.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page