Finish wheel build section in distribution guide

This commit is contained in:
messense 2017-08-07 11:43:49 +08:00
parent 1ad8ad102a
commit 59d9f9e453
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
1 changed files with 25 additions and 1 deletions

View File

@ -25,6 +25,30 @@ python setup.py sdist
To build a binary wheel, [manylinux](https://github.com/pypa/manylinux) would be a natural choice for Linux.
TODO: an manylinux1 example, macOS wheel
Take the [example](https://github.com/PyO3/setuptools-rust/tree/master/example) project in [`setuptools-rust`][setuptools-rust] repository for example,
we have a [`build-wheels.sh`](https://github.com/PyO3/setuptools-rust/blob/master/example/build-wheels.sh) to be used with Docker to build manylinux1 wheels.
First you need to pull the `manylinux1` Docker image:
```bash
$ docker pull quay.io/pypa/manylinux1_x86_64
```
Then use the following command to build wheels for supported Python versions:
```bash
$ docker run --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/build-wheels.sh
```
You will find all the wheels in `dist` directory:
```bash
$ ls dist
hello_rust-1.0-cp27-cp27m-linux_x86_64.whl hello_rust-1.0-cp35-cp35m-linux_x86_64.whl
hello_rust-1.0-cp27-cp27m-manylinux1_x86_64.whl hello_rust-1.0-cp35-cp35m-manylinux1_x86_64.whl
hello_rust-1.0-cp27-cp27mu-linux_x86_64.whl hello_rust-1.0-cp36-cp36m-linux_x86_64.whl
hello_rust-1.0-cp27-cp27mu-manylinux1_x86_64.whl hello_rust-1.0-cp36-cp36m-manylinux1_x86_64.whl
```
The `*-manylinux1_x86_64.whl` files are the `manylinux1` wheels that you can upload to PyPi.
[setuptools-rust]: https://github.com/PyO3/setuptools-rust