Skip to content

Commit e876256

Browse files
committed
docs: fix build-wheels.sh
1 parent df3bf6c commit e876256

File tree

3 files changed

+17
-50
lines changed

3 files changed

+17
-50
lines changed

build-wheels.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/building_wheels.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,16 @@ The [`rtoml` package does this, for example](https://github.com/samuelcolvin/rto
1414

1515
Place a script called `build-wheels.sh` with the following contents in your project root (next to the `setup.py` file):
1616

17-
```bash
18-
#!/bin/bash
19-
set -ex
20-
21-
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
22-
export PATH="$HOME/.cargo/bin:$PATH"
23-
24-
cd /io
25-
26-
for PYBIN in /opt/python/cp{36,37,38,39}*/bin; do
27-
"${PYBIN}/pip" install -U setuptools wheel setuptools-rust
28-
"${PYBIN}/python" setup.py bdist_wheel
29-
done
30-
31-
for whl in dist/*.whl; do
32-
auditwheel repair "$whl" -w dist/
33-
done
17+
```{eval-rst}
18+
.. literalinclude:: ../examples/html-py-ever/build-wheels.sh
19+
:language: bash
3420
```
3521

3622
This script can be used to produce wheels for multiple Python versions.
3723

3824
### Binary wheels on linux
3925

40-
To build binary wheels on linux, you need to use the [manylinux docker container](https://github.com/pypa/manylinux). You also need a `build-wheels.sh` similar to [the one in the example](https://github.com/PyO3/setuptools-rust/blob/main/examples/html-py-ever/build-wheels.sh), which will be run in that container.
26+
To build binary wheels on linux, you need to use the [manylinux docker container](https://github.com/pypa/manylinux). You will run the `build-wheels.sh` from above inside that container.
4127

4228
First, pull the `manylinux2014` Docker image:
4329

examples/html-py-ever/build-wheels.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
#!/bin/bash
22
set -ex
33

4-
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
4+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
55
export PATH="$HOME/.cargo/bin:$PATH"
66

7-
cd /io
7+
# Compile wheels
8+
for PYBIN in /opt/python/cp{36,37,38,39,310}*/bin; do
9+
rm -rf /io/build/
10+
"${PYBIN}/pip" install -U setuptools setuptools-rust wheel
11+
"${PYBIN}/pip" wheel /io/ -w /io/dist/ --no-deps
12+
done
813

9-
for PYBIN in /opt/python/cp{35,36,37,38,39}*/bin; do
10-
"${PYBIN}/pip" install -U setuptools wheel setuptools-rust
11-
"${PYBIN}/python" setup.py bdist_wheel
14+
# Bundle external shared libraries into the wheels
15+
for whl in /io/dist/*{cp36,cp37,cp38,cp39,cp310}*.whl; do
16+
auditwheel repair "$whl" -w /io/dist/
1217
done
1318

14-
for whl in dist/*.whl; do
15-
auditwheel repair "$whl" -w dist/
19+
# Install packages and test
20+
for PYBIN in /opt/python/cp{36,37,38,39,310}*/bin; do
21+
"${PYBIN}/pip" install html-py-ever -f /io/dist/
1622
done

0 commit comments

Comments
 (0)