Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Contributing to `wasmtime-py`

`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!

## Set Up

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):

[wasmtime]: https://wasmtime.dev/

```sh
$ python download-wasmtime.py
```

Otherwise 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).

Finally, install the dev dependencies with `pip`:

```
$ pip install -e ".[testing]"
```

## Testing

After you've completed the set up steps, you can run the tests locally with
`pytest`:

```
$ pytest
```

### CI and Releases

The CI for this project does a few different things:

* API docs are generated for pushes to the `main` branch and are [published
online][apidoc].

* Test coverage information is generated for pushes to the `main` branch and are
[available online](https://bytecodealliance.github.io/wasmtime-py/coverage/).

* Each push to `main` will publish a release to
[test.pypi.org](https://test.pypi.org/project/wasmtime/) for local inspection.

* Tagged commits will automatically be published to
[pypi.org](https://pypi.org/project/wasmtime/).

All commits/PRs run the full test suite, and check for code style
and other errors using [flake8](https://flake8.pycqa.org/).

[Bytecode Alliance]: https://bytecodealliance.org/
[Code of Conduct]: CODE_OF_CONDUCT.md
[Organizational Code of Conduct]: ORG_CODE_OF_CONDUCT.md
[Wasmtime]: https://github.com/bytecodealliance/wasmtime
[apidoc]: https://bytecodealliance.github.io/wasmtime-py/
54 changes: 2 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

## Installation

To install wasmtime-py, run this command in your terminal:
To install `wasmtime-py`, run this command in your terminal:

```bash
$ pip install wasmtime
Expand Down Expand Up @@ -85,54 +85,4 @@ print(your_wasm_file.run())

## Contributing

So far this extension has been written by folks who are primarily Rust
programmers, so it's highly likely that there's some faux pas in terms of Python
idioms. Feel free to create a PR to help make things more idiomatic
if you see something!

To work on this extension locally you'll first want to clone the project:

```sh
$ git clone https://github.com/bytecodealliance/wasmtime-py
$ cd wasmtime-py
```

Next up you'll acquire a [Wasmtime] installation. The wasmtime-py package expects
your platform's shared library to exist at `wasmtime/wasmtime.pyd`. 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):

[wasmtime]: https://wasmtime.dev/

```sh
$ python download-wasmtime.py
```

Otherwise if you have a local checkout of Wasmtime you can symlink
its `libwasmtime.so` (or equivalent) to `wasmtime/wasmtime.pyd`.

After you've got Wasmtime set up you can check it works by running all the
unit tests:

```sh
$ pip install pytest
$ pytest
```

After that you should be good to go!

### CI and Releases

The CI for this project does a few different things:

* API docs are generated for pushes to the `main` branch and are [published
online][apidoc].
* Test coverage information is generated for pushes to the `main` branch and are
[available online](https://bytecodealliance.github.io/wasmtime-py/coverage/).
* Each push to `main` will publish a release to
[test.pypi.org](https://test.pypi.org/project/wasmtime/) for local inspection.
* Tagged commits will automatically be published to
[pypi.org](https://pypi.org/project/wasmtime/).

All commits/PRs run the full test suite, and check for code style
and other errors using [flake8](https://flake8.pycqa.org/).
See [`CONTRIBUTING.md`](./CONTRIBUTING.md).