From 03a7ded36b2e90b1bc1fefcf9e7b21d263fbbc81 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Mon, 13 Jul 2020 11:44:48 -0700 Subject: [PATCH 1/2] Split contribution instructions out to CONTRIBUTING.md Also update the set up and testing instructions. --- CONTRIBUTING.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 54 ++-------------------------------------- 2 files changed, 67 insertions(+), 52 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..e2b0f5a6 --- /dev/null +++ b/CONTRIBUTING.md @@ -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 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! + +## Set Up + +You'll need to 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`. + +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/ diff --git a/README.md b/README.md index fb9ceca7..8a27c223 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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). From 6dcff045ff3bf4228381c694e68f6e23285e53f8 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 13 Jul 2020 13:07:14 -0700 Subject: [PATCH 2/2] Tweak some words in CONTRIBUTING --- CONTRIBUTING.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e2b0f5a6..860c53e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,16 +4,15 @@ 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 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! +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/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): +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/ @@ -21,8 +20,9 @@ the top-level directory of the package's source (this is what CI does): $ 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`. +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`: