From b36e75e307ba240f0cdd1b0e0e8783eab2dcf771 Mon Sep 17 00:00:00 2001 From: messense Date: Tue, 27 Jun 2017 21:09:16 +0800 Subject: [PATCH] Some distribution guide doc --- guide/src/distribution.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/guide/src/distribution.md b/guide/src/distribution.md index 7034ef97..5bacdb7a 100644 --- a/guide/src/distribution.md +++ b/guide/src/distribution.md @@ -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