From 9f0ae241e99e180a4fc2ce6b23b34e6bebf0b2de Mon Sep 17 00:00:00 2001 From: Ben Jeffery Date: Tue, 16 Jun 2020 00:09:54 +0100 Subject: [PATCH] Use oldest-supported-numpy in wheel building --- .github/workflows/wheels.yml | 8 +++++++- docker/buildwheel.sh | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5813c1a..cae0145 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -24,10 +24,13 @@ jobs: env: PYTHON: "py -${{ matrix.python }}-${{ matrix.wordsize }}" shell: bash + # Instead of letting setup.py install a newer numpy we install it here + # using the oldest supported version for ABI compatibility run: | set -ex ${PYTHON} -m pip install --upgrade pip - ${PYTHON} -m pip install setuptools wheel cython + ${PYTHON} -m pip install setuptools wheel + ${PYTHON} -m pip install oldest-supported-numpy - name: Build C extension env: PYTHON: "py -${{ matrix.python }}-${{ matrix.wordsize }}" @@ -81,9 +84,12 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install deps + # Instead of letting setup.py install a newer numpy we install it here + # using the oldest supported version for ABI compatibility run: | pip install --upgrade pip pip install setuptools wheel + pip install oldest-supported-numpy - name: Build C extension run: | cd python diff --git a/docker/buildwheel.sh b/docker/buildwheel.sh index 6394d5e..ec42d5f 100644 --- a/docker/buildwheel.sh +++ b/docker/buildwheel.sh @@ -11,6 +11,9 @@ cd python for V in "${PYTHON_VERSIONS[@]}"; do PYBIN=/opt/python/$V/bin rm -rf build/ # Avoid lib build by narrow Python is used by wide python + # Instead of letting setup.py install a newer numpy we install it here + # using the oldest supported version for ABI compatibility + $PYBIN/pip install oldest-supported-numpy $PYBIN/python setup.py build_ext --inplace $PYBIN/python setup.py bdist_wheel done