wasmtime-py is a Bytecode Alliance project. It follows the Bytecode
Alliance's Code of Conduct and Organizational Code of Conduct.
So far this extension has been written by folks who are primarily Rust programmers, so feel free to create a PR to help make things more idiomatic if you see something!
You'll need to acquire a Wasmtime installation. The wasmtime-py package
expects your platform's shared library to exist at wasmtime/{host}/_{library}.
You can download the latest development version of Wasmtime by running a script
in the top-level directory of the package's source (this is what CI does):
$ python ci/download-wasmtime.pyOtherwise if you have a local checkout of Wasmtime you can symlink its
libwasmtime.so (or equivalent) to wasmtime/linux-x86_64/_libwasmtime.so (or
equivalent).
Next install the dev dependencies with pip:
$ pip install -e ".[testing]"
On Windows, the below will require gcc to be installed locally and on the PATH.
The easiest way to do this is via an installer such as https://github.com/msys2/msys2-installer/releases/download/2024-12-08/msys2-x86_64-20241208.exe,
and then in the MSYS2 terminal run the command pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain to install GCC. Put C:\msys64\ucrt64\bin (or
wherever you installed GCC to) on the end of the PATH (if earlier on the PATH its
version of Python may get picked up before the desired version).
After you've completed the set up steps, you can run the tests locally with
pytest:
$ pytest
The CI for this project does a few different things:
-
API docs are generated for pushes to the
mainbranch and are published online. -
Test coverage information is generated for pushes to the
mainbranch and are available online. -
Each push to
mainwill publish a release to test.pypi.org for local inspection. -
Tagged commits will automatically be published to pypi.org.
All commits/PRs run the full test suite, and check for code style and other errors using flake8.