From 2f017a08e81803e873937a4b82d533f19ba1fc75 Mon Sep 17 00:00:00 2001 From: Chris Harris Date: Mon, 14 Sep 2026 13:04:28 +0000 Subject: [PATCH 1/2] Update wheel CI actions and host Python to remove deprecation warnings --- .github/scripts/install.sh | 3 ++- .github/workflows/build_wheels.yml | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index fed93ab1..ef9d9b8d 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash set -ev -pip install cibuildwheel +# Keep the tested builder version when upgrading the host Python. +python -m pip install cibuildwheel==2.23.4 if [[ $RUNNER_OS == "Windows" ]]; then .github/scripts/install_eigen_windows.sh diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 1fc72886..4c7b9def 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -54,17 +54,18 @@ jobs: - os: windows-2025 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 with: # Grab the whole history so that setuptools-scm can see the tags and # give it a correct version even on non-tag push. fetch-depth: 0 submodules: recursive - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 name: Install Python with: - python-version: '3.10' + # Host Python for cibuildwheel. Wheel targets are selected separately. + python-version: '3.12' - name: Install dependencies run: . .github/scripts/install.sh @@ -72,7 +73,7 @@ jobs: - name: Build wheels run: cibuildwheel --output-dir wheelhouse - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v6 with: name: wheels-${{ matrix.os }} path: ./wheelhouse/*.whl @@ -84,7 +85,7 @@ jobs: # upload to PyPI on every tag push if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v7 with: pattern: wheels-* path: dist From e0af2e102437d083f869fef73ca78db94846cf43 Mon Sep 17 00:00:00 2001 From: Chris Harris Date: Mon, 14 Sep 2026 13:15:21 +0000 Subject: [PATCH 2/2] Upgrade cibuildwheel to 4.2.1 and update Linux wheel repair --- .github/scripts/install.sh | 3 +-- .github/scripts/repair_command_linux.sh | 21 +++++++++++---------- .github/workflows/build_wheels.yml | 11 ++++++++--- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/.github/scripts/install.sh b/.github/scripts/install.sh index ef9d9b8d..5e70e46f 100644 --- a/.github/scripts/install.sh +++ b/.github/scripts/install.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash set -ev -# Keep the tested builder version when upgrading the host Python. -python -m pip install cibuildwheel==2.23.4 +python -m pip install cibuildwheel==4.2.1 if [[ $RUNNER_OS == "Windows" ]]; then .github/scripts/install_eigen_windows.sh diff --git a/.github/scripts/repair_command_linux.sh b/.github/scripts/repair_command_linux.sh index 45460998..935f4f20 100644 --- a/.github/scripts/repair_command_linux.sh +++ b/.github/scripts/repair_command_linux.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -ev +set -euv # FIXME: if the libraries are already inside the wheel, why do we have # to provide them to auditwheel again? It would be ideal if we could @@ -7,15 +7,16 @@ set -ev # We have to include the stempy library in Linux's LD_LIBRARY_PATH, # or auditwheel won't work. These libraries are already in the wheel. -WHEEL_DIR=/tmp/cibuildwheel/built_wheel -WHEEL_PATH=$(find $WHEEL_DIR -name "*.whl" | xargs readlink -f) +WHEEL_PATH=$(realpath "$1") +DEST_DIR=$(realpath "$2") +REPAIR_DIR=$(mktemp -d) +trap 'rm -rf -- "$REPAIR_DIR"' EXIT -cd $WHEEL_DIR -unzip $WHEEL_PATH +unzip -q "$WHEEL_PATH" -d "$REPAIR_DIR" -LIBRARY_DIR=$(find $WHEEL_DIR -name "libstem.so" | head -n 1 | xargs readlink -f | xargs dirname) -export LD_LIBRARY_PATH=$LIBRARY_DIR:$LD_LIBRARY_PATH +LIBRARY_PATH=$(find "$REPAIR_DIR" -name "libstem.so" -print -quit) +test -n "$LIBRARY_PATH" +LIBRARY_DIR=$(dirname "$LIBRARY_PATH") +export LD_LIBRARY_PATH="$LIBRARY_DIR${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" -auditwheel repair -w /tmp/cibuildwheel/repaired_wheel $WHEEL_PATH - -rm -rf /tmp/cibuildwheel/built_wheel +auditwheel repair -w "$DEST_DIR" "$WHEEL_PATH" diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 4c7b9def..d5db0b8e 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -9,15 +9,20 @@ on: pull_request: env: - # Only support 64-bit CPython > 3.6 - CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *-manylinux_i686 *-musllinux_* *-win32 cp314-*" + CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-* cp313-*" + CIBW_SKIP: "*-manylinux_i686 *-musllinux_* *-win32" # This has some of the software we need pre-installed on it CIBW_MANYLINUX_X86_64_IMAGE: openchemistry/stempy_wheel_builder_x86_64 CIBW_MANYLINUX_AARCH64_IMAGE: openchemistry/stempy_wheel_builder_aarch64 # Need to do some setup before repairing the wheel on linux... - CIBW_REPAIR_WHEEL_COMMAND_LINUX: bash .github/scripts/repair_command_linux.sh + CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- + bash "{project}/.github/scripts/repair_command_linux.sh" "{wheel}" "{dest_dir}" + + # CMake already bundles stem.dll beside the Python extensions. + CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >- + delvewheel repair --ignore-existing -w "{dest_dir}" -v "{wheel}" # Specify eigen location for windows, and force it to use python in the path... CIBW_ENVIRONMENT_WINDOWS: >