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