Skip to main content

Tool to package Python applications as WebAssembly components

Project description

componentize-py

This is a prototype of a tool to convert a Python application to a WebAssembly component. It takes the following as input:

  • a WIT file or directory
  • the name of a WIT world defined in the above file or directory
  • the name of a Python module which targets said world
  • a list of directories in which to find the Python module and its dependencies

The output is a component which may be run using e.g. wasmtime. See the tests for examples.

Build Prerequisites

  • WASI SDK v16 (later versions may work, but have not yet been tested)
    • Install this to /opt/wasi-sdk, or else specify an alternative location via the WASI_SDK_PATH environment variable
  • Tools needed to build CPython (e.g. Make, Clang, etc.)
  • Rust v1.68 or later, including the wasm32-wasi and wasm32-unknown-unkown targets

Building and Running

cargo run --release -- --help

Running Tests

The tests live in a separate crate due to an incompatibility between the version of wasmtime which wizer uses and the one we use to test.

(cd test && cargo test --release)

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

componentize_py-0.1.0.tar.gz (26.6 MB view hashes)

Uploaded Source

Built Distributions

componentize_py-0.1.0-cp311-abi3-win_amd64.whl (13.1 MB view hashes)

Uploaded CPython 3.11+ Windows x86-64

componentize_py-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.9 MB view hashes)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ x86-64

componentize_py-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (15.6 MB view hashes)

Uploaded CPython 3.11+ manylinux: glibc 2.17+ ARM64

componentize_py-0.1.0-cp311-abi3-macosx_11_0_arm64.whl (13.7 MB view hashes)

Uploaded CPython 3.11+ macOS 11.0+ ARM64

componentize_py-0.1.0-cp311-abi3-macosx_10_7_x86_64.whl (14.4 MB view hashes)

Uploaded CPython 3.11+ macOS 10.7+ x86-64

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