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
82 changes: 73 additions & 9 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,37 @@ jobs:
cp -r build/lib/* pyvcell_odesolver/lib/
uv sync --extra build --extra test
uv run pytest
uv build --wheel -o wheelhouse

- name: Re-tag Python Wheel <x86_64>
if: matrix.platform.type == 'gnu_amd64'
run: uv run python -m wheel tags --remove --platform-tag manylinux_2_28_x86_64 ./wheelhouse/$(ls ./wheelhouse)
uv build --wheel -o dist

- name: Re-tag Python Wheel <ARM64>
if: matrix.platform.type == 'gnu_arm64'
run: uv run python -m wheel tags --remove --platform-tag manylinux_2_28_aarch64 ./wheelhouse/$(ls ./wheelhouse)
# libIDAWin.so links clang's libc++, libc++abi and libunwind, which a stock Linux does not have (the release
# archive bundles them too, package_linux.sh). auditwheel copies them into the wheel (pyvcell_odesolver.libs/)
# and sets the rpath; it starts from a platform-tagged wheel and finds them in clang's resource tree.
- name: Repair the Python wheel (bundle the C++ runtime)
shell: bash
run: |
set -euo pipefail
arch="$(uname -m)"
uv run python -m wheel tags --remove --platform-tag "linux_$arch" ./dist/$(ls ./dist)
search=""
for lib in libc++.so.1 libc++abi.so.1 libunwind.so.1; do
p="$(clang++ -print-file-name="$lib" 2>/dev/null || true)"
if [ -n "$p" ] && [ "${p#/}" != "$p" ] && [ -e "$p" ]; then search="$search:$(dirname "$p")"; fi
done
AUDITWHEEL=auditwheel; command -v auditwheel > /dev/null || AUDITWHEEL="uvx auditwheel"
export LD_LIBRARY_PATH="${search#:}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
$AUDITWHEEL repair --plat "manylinux_2_28_$arch" -w wheelhouse ./dist/*.whl
# auditwheel counts libatomic (which libc++ needs) as a system library, but a minimal RHEL 8 lacks it:
# put it beside the bundled libc++, whose rpath is $ORIGIN (the release archive bundles it too)
libatomic="$(ldd "$(clang++ -print-file-name=libc++.so.1)" | awk '$1 == "libatomic.so.1" {print $3}')"
if [ -n "$libatomic" ]; then
uv run python -m wheel unpack -d unpacked ./wheelhouse/*.whl
libcxx="$(find unpacked -name 'libc++-*.so*' | head -1)"
if [ -z "$libcxx" ]; then find unpacked; echo "::error::no bundled libc++ in the repaired wheel"; exit 1; fi
cp -L "$libatomic" "$(dirname "$libcxx")/libatomic.so.1"
uv run python -m wheel pack -d wheelhouse unpacked/*
fi
$AUDITWHEEL show wheelhouse/*.whl
python3 -m zipfile -l wheelhouse/*.whl | grep -E '\.so'

- name: Upload Python Wheel
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -547,6 +569,48 @@ jobs:
fi


verify-wheels:
name: Verify the ${{ matrix.wheel }} wheel on ${{ matrix.container || matrix.runner }}
needs: [ Linux ]
strategy:
fail-fast: false
matrix:
include:
- { wheel: gnu_amd64, runner: ubuntu-24.04 }
- { wheel: gnu_amd64, runner: ubuntu-24.04, container: "rockylinux:8" } # glibc 2.28
- { wheel: gnu_arm64, runner: ubuntu-24.04-arm }
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}
steps:
- name: Tools for a bare container
if: matrix.container != ''
run: |
dnf module enable -y nodejs:24
dnf install -y nodejs python3.11 python3.11-pip

- uses: actions/checkout@v6
with:
sparse-checkout: tests/reference

- uses: actions/download-artifact@v8
with:
name: pyvcell-ode-${{ matrix.wheel }}
path: dl

# a clean system, without clang's runtime: the wheel must carry everything libIDAWin.so loads
- name: Install the wheel and solve a reference input
shell: bash
run: |
set -euo pipefail
py=python3; command -v python3.11 > /dev/null && py=python3.11
$py -m venv "$RUNNER_TEMP/venv"
"$RUNNER_TEMP/venv/bin/pip" install -q dl/*.whl
cd tests/reference
"$RUNNER_TEMP/venv/bin/python" -c "import pyvcell_odesolver as o; print(o.version())"
"$RUNNER_TEMP/venv/bin/python" -c "import sys, pyvcell_odesolver as o; sys.exit(o.solve('cvode_simple.cvodeInput', sys.argv[1], 0))" "$RUNNER_TEMP/cvode_simple.ida"
"$RUNNER_TEMP/venv/bin/python" compare_ida.py cvode_simple.ida.ref "$RUNNER_TEMP/cvode_simple.ida"


release-assets:
name: Attach release assets
if: github.event_name == 'release' && github.event.action == 'published'
Expand Down Expand Up @@ -584,7 +648,7 @@ jobs:

publish-to-pypi:
name: Publish to PyPI
needs: [ WindowsOS, MacOS-Universal, Linux, verify-archives ]
needs: [ WindowsOS, MacOS-Universal, Linux, verify-archives, verify-wheels ]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
environment: pypi
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "uv_build"

[project]
name = "pyvcell_odesolver"
version = "0.9.6"
version = "0.9.7"
description="Virtual Cell CVODE / IDA based ODE solver"
readme = "README.md"
authors = [
Expand Down
Loading