|
| 1 | +#!/bin/bash |
| 2 | +# |
| 3 | +# Build manylinux1 wheels for cutadapt. Based on the example at |
| 4 | +# <https://github.com/pypa/python-manylinux-demo> |
| 5 | +# |
| 6 | +# It is best to run this in a fresh clone of the repository! |
| 7 | +# |
| 8 | +# Run this within the repository root: |
| 9 | +# docker run --rm -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 /io/buildwheels.sh |
| 10 | +# |
| 11 | +# The wheels will be put into the wheelhouse/ subdirectory. |
| 12 | +# |
| 13 | +# For interactive tests: |
| 14 | +# docker run -it -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 /bin/bash |
| 15 | + |
| 16 | +set -xeuo pipefail |
| 17 | + |
| 18 | +# For convenience, if this script is called from outside of a docker container, |
| 19 | +# it starts a container and runs itself inside of it. |
| 20 | +if ! grep -q docker /proc/1/cgroup; then |
| 21 | + # We are not inside a container |
| 22 | + exec docker run --rm -v $(pwd):/io quay.io/pypa/manylinux1_x86_64 /io/$0 |
| 23 | +fi |
| 24 | + |
| 25 | +# Python 2.6 is not supported |
| 26 | +rm -r /opt/python/cp26* |
| 27 | + |
| 28 | +PYBINS="/opt/python/*/bin" |
| 29 | +HAS_CYTHON=0 |
| 30 | +for PYBIN in ${PYBINS}; do |
| 31 | + ${PYBIN}/pip install Cython |
| 32 | +# ${PYBIN}/pip install -r /io/requirements.txt |
| 33 | + ${PYBIN}/pip wheel /io/ -w wheelhouse/ |
| 34 | +done |
| 35 | + |
| 36 | +# Bundle external shared libraries into the wheels |
| 37 | +for whl in wheelhouse/cutadapt-*.whl; do |
| 38 | + auditwheel repair "$whl" -w /io/wheelhouse/ |
| 39 | +done |
| 40 | + |
| 41 | +# Created files are owned by root, so fix permissions. |
| 42 | +chown -R --reference=/io/setup.py /io/wheelhouse/ |
| 43 | + |
| 44 | +# TODO Install packages and test them |
| 45 | +#for PYBIN in ${PYBINS}; do |
| 46 | +# ${PYBIN}/pip install cutadapt --no-index -f /io/wheelhouse |
| 47 | +# (cd $HOME; ${PYBIN}/nosetests ...) |
| 48 | +#done |
0 commit comments