Skip to content

Commit b58f8d8

Browse files
committed
Add build-wheels.sh in example for building manylinux1 wheels
1 parent f12952b commit b58f8d8

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

example/README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Build manylinux1 wheels
2+
-----------------------------
3+
4+
.. code-block:: bash
5+
6+
docker run --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/build-wheels.sh

example/build-wheels.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
set -e -x
3+
4+
mkdir ~/rust-installer
5+
curl -sL https://static.rust-lang.org/rustup.sh -o ~/rust-installer/rustup.sh
6+
sh ~/rust-installer/rustup.sh --prefix=~/rust --spec=nightly -y --disable-sudo
7+
export PATH="$HOME/rust/bin:$PATH"
8+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/rust/lib"
9+
10+
# Compile wheels
11+
for PYBIN in /opt/python/cp{27,35,36}*/bin; do
12+
export PYTHON_LIB=$(${PYBIN}/python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
13+
export LIBRARY_PATH="$LIBRARY_PATH:$PYTHON_LIB"
14+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PYTHON_LIB"
15+
"${PYBIN}/pip" install -U setuptools setuptools-rust wheel
16+
"${PYBIN}/pip" wheel /io/ -w /io/dist/
17+
done
18+
19+
# Bundle external shared libraries into the wheels
20+
for whl in /io/dist/*.whl; do
21+
auditwheel repair "$whl" -w /io/dist/
22+
done
23+
24+
# Install packages and test
25+
for PYBIN in /opt/python/cp{27,35,36}*/bin/; do
26+
"${PYBIN}/pip" install hello-rust --no-index -f /io/dist/
27+
done

0 commit comments

Comments
 (0)