From 969681abaa009bedb772ba4919a0c1e01e289b17 Mon Sep 17 00:00:00 2001 From: David Hoese Date: Fri, 22 Sep 2023 06:03:04 -0500 Subject: [PATCH] Include more archs in wheel building --- .github/workflows/deploy.yaml | 64 +++++++------------ .../build-manylinux-wheels.sh | 47 -------------- 2 files changed, 22 insertions(+), 89 deletions(-) delete mode 100755 continuous_integration/build-manylinux-wheels.sh diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 30f783903..5de24e44b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: Deploy sdist and wheels +name: Build sdist and wheels # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency # https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types#pullrequestevent concurrency: @@ -21,6 +21,8 @@ jobs: - name: Create sdist shell: bash -l {0} + # For non-tags/releases this won't produce a valid version number in the package + # We'd have to download the entire git history which is wasteful in CI run: | python -m pip install -q build python -m build -s @@ -33,61 +35,39 @@ jobs: build_wheels: - name: "Build wheels on ${{ matrix.os }}" + name: "Build wheels on ${{ matrix.os }} ${{ matrix.cibw_archs }}" runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [windows-2019, macos-11, ubuntu-20.04] + include: + - os: windows-2019 + cibw_archs: "AMD64 ARM64" + - os: macos-11 + cibw_archs: "x86_64 arm64" + - os: "ubuntu-20.04" + cibw_archs: "aarch64" + - os: "ubuntu-20.04" + cibw_archs: "x86_64" steps: - uses: actions/checkout@v4 - run: | git fetch --prune --unshallow + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: all + - name: Build wheels uses: pypa/cibuildwheel@v2.16.0 env: - CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *-manylinux_i686 *-musllinux*" - CIBW_ARCHS: auto64 + CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *i686 *-musllinux_aarch64" + CIBW_ARCHS: "${{ matrix.cibw_archs }}" CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\"" - - -# -# -# - name: Install dependencies -# run: | -# python -m pip install -U -q pip Cython wheel setuptools twine numpy build -# -# - name: Build and install macOS/Windows wheel -# if: matrix.os != 'ubuntu-latest' -# run: | -# python -m build -w -# pip install --find-links=./dist/ pyresample -# -# - name: Build Linux wheels inside docker -# if: matrix.os == 'ubuntu-latest' -# run: | -# docker run \ -# -e PLAT=${{ matrix.docker-image }} \ -# -e USE_OMP=1 \ -# -v `pwd`:/io \ -# quay.io/pypa/${{ matrix.docker-image }} \ -# /io/continuous_integration/build-manylinux-wheels.sh -# -# - name: Check version number from inside wheel -# if: matrix.docker-image != 'manylinux2014_i686' -# # install dependencies -# # uninstall source installation -# # move source to make sure it isn't include in checks -# run: | -# python -m pip install pip-tools -# python -m piptools compile -o requirements.txt -# mv pyresample unused_src_to_prevent_local_import -# python -m pip install -r requirements.txt -# python -m pip install --force-reinstall --no-index --no-cache-dir --no-deps --find-links=./dist/ pyresample -# python -c "import pyresample; print(pyresample.__file__, pyresample.__version__)" -# python -c "import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'" + CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64" - name: Upload wheel(s) as build artifacts uses: actions/upload-artifact@v3 diff --git a/continuous_integration/build-manylinux-wheels.sh b/continuous_integration/build-manylinux-wheels.sh deleted file mode 100755 index 34296da96..000000000 --- a/continuous_integration/build-manylinux-wheels.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -set -e -x - -# This is to be run by Docker inside a Docker image. -# You can test it locally on a Linux machine by installing docker and running from this repo's root: -# $ docker run -e PLAT=manylinux1_x86_64 -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 /io/scripts/build-manylinux-wheels.sh - -# * The -e just defines an environment variable PLAT=[docker name] inside the -# docker - auditwheel can't detect the docker name automatically. -# * The -v gives a directory alias for passing files in and out of the docker -# (/io is arbitrary). E.g the `setup.py` script would be accessed in the -# docker via `/io/setup.py`. -# * quay.io/pypa/manylinux1_x86_64 is the full docker image name. Docker -# downloads it automatically. -# * The last argument is a shell command that the Docker will execute. -# Filenames must be from the Docker's perspective. - -# Wheels are initially generated as you would usually, but put in a temp -# directory temp-wheels. The pip-cache is optional but can speed up local builds -# having a real permanent pip-cache dir. -mkdir -p /io/pip-cache -mkdir -p /io/temp-wheels - -# Clean out any old existing wheels. -find /io/temp-wheels/ -type f -delete - -# /io might be owned by someone else since we are in docker -# this may stop versioneer from using git the way it needs -git config --global --add safe.directory /io - -# Iterate through available pythons. -for PYBIN in /opt/python/cp3{9,10,11}*/bin; do - "${PYBIN}/pip" install -q -U setuptools wheel --cache-dir /io/pip-cache - # Run the following in root of this repo. - (cd /io/ && "${PYBIN}/pip" install -q .) - (cd /io/ && "${PYBIN}/python" -m build -w -o /io/temp-wheels) -done - -"$PYBIN/pip" install -q auditwheel - -# Wheels aren't considered manylinux unless they have been through -# auditwheel. Audited wheels go in /io/dist/. -mkdir -p /io/dist/ - -for whl in /io/temp-wheels/*.whl; do - auditwheel repair "$whl" --plat "$PLAT" -w /io/dist/ -done