Some distribution guide doc

This commit is contained in:
messense 2017-06-27 21:09:16 +08:00
parent 800fa231ba
commit b36e75e307
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
1 changed files with 20 additions and 3 deletions

View File

@ -2,12 +2,29 @@
## `setuptools-rust` integration
TODO
[`setuptools-rust`][setuptools-rust] is a setuptools helpers for Rust Python extensions. It supports `PyO3` by default.
For detailed usage, please refer to its [README](https://github.com/PyO3/setuptools-rust/blob/master/README.rst)
## Source distribution
TODO
To build a source code distribution, you need to add the following lines to your `MANIFEST.in` file to ensure it correctly packages Rust extension source code.
```text
include Cargo.toml
recursive-include src *
```
Then you can build a source code distribution by (assuming you have already written a `setup.py`):
```bash
python setup.py sdist
```
## Binary wheel distribution
TODO
To build a binary wheel, [manylinux](https://github.com/pypa/manylinux) would be a natural choice for Linux.
TODO: an manylinux1 example, macOS wheel
[setuptools-rust]: https://github.com/PyO3/setuptools-rust