Skip to content

john-g-g/componentize-py

 
 

Repository files navigation

componentize-py

This is 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.

For an example of running a sandboxed Python guest within a Python host, see component-sandbox-demo.

Installing from PyPI

pip install componentize-py

Building from source

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%