build_wheel.sh
author Philippe Pepiot <philippe.pepiot@logilab.fr>
Wed, 06 Nov 2019 11:27:36 +0100
changeset 868 3ee87bec4482
parent 818 7f89d2d976e7
child 885 6db0f3b97ff8
permissions -rwxr-xr-x
Stop building python2 wheels and workaround broken py38 wheel This script is used to publish wheel binary packages to pypi. Since we're going to remove python2 support, stop generating wheels for python2. Also py38 is out and our wheel doesn't compile with py38 due to a bug of logilab-common. Waiting a fix, don't build wheel for py38. % docker run --rm -it quay.io/pypa/manylinux1_x86_64 ls -1A /opt/python cp27-cp27m cp27-cp27mu cp34-cp34m cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38

#!/bin/sh

set -ex

mkdir -p dist
if ! test -e /.dockerenv; then
  exec docker run --rm -it -v $(pwd):/mnt/host/rql quay.io/pypa/manylinux1_x86_64 sh /mnt/host/rql/$0
fi

cd /mnt/host
VERSION=4.4.0
curl -L https://github.com/Gecode/gecode/archive/release-$VERSION.tar.gz | tar -xzf -
cd gecode-release-$VERSION
./configure
make -j2
make install

PYBINS="/opt/python/cp34*/bin /opt/python/cp35*/bin /opt/python/cp36*/bin /opt/python/cp37*/bin"

mkdir -p /wheelhouse
# Compile wheels
for PYBIN in $PYBINS; do
    "${PYBIN}/pip" wheel /mnt/host/rql -w /wheelhouse
done

# Bundle external shared libraries into the wheels
for whl in /wheelhouse/rql*.whl; do
    auditwheel repair "$whl" -w /wheelhouse
done

# Install packages and test
for PYBIN in $PYBINS; do
    "${PYBIN}/pip" install pytest
    "${PYBIN}/pip" install rql --no-index -f /wheelhouse
    echo "************  test on $PYBIN"
    (cd "/mnt/host"; "${PYBIN}/py.test" rql)
done
mv /wheelhouse/rql*manylinux*.whl /mnt/host/rql/dist/