Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ev

pip install cibuildwheel
python -m pip install cibuildwheel==4.2.1

if [[ $RUNNER_OS == "Windows" ]]; then
.github/scripts/install_eigen_windows.sh
Expand Down
21 changes: 11 additions & 10 deletions .github/scripts/repair_command_linux.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#!/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
# avoid this script entirely.

# 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"
22 changes: 14 additions & 8 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
Expand Down Expand Up @@ -54,25 +59,26 @@ 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

- 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
Expand All @@ -84,7 +90,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
Expand Down
Loading