From bdb8733bfcaa4d048dcdd7af5e1b372c11e13645 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 14:49:15 +0000 Subject: [PATCH] Add workflow building manylinux_2_28 wheels Builds x86_64 wheels for CPython 3.9-3.13 with cibuildwheel on version tags and on demand, smoke-tests that every compiled module imports from the repaired wheel, and attaches wheels plus sdist to the GitHub Release on tags. This lets deployments pip install a prebuilt wheel instead of compiling the C++ extensions on every machine. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_0165n5fATQ2icKWKHQXY6XEo --- .github/workflows/wheels.yml | 85 ++++++++++++++++++++++++++++++++++++ docs/pacemaker/install.md | 11 ++++- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/wheels.yml diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 0000000..31369ff --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,85 @@ +# Build portable (manylinux_2_28, x86_64) binary wheels of pyace so that +# deployments can `pip install` them instead of compiling the C++ extensions +# on every machine. +# +# Runs on version tags and on demand. Wheels are always attached to the +# workflow run as artifacts; on a tag they are also attached to a GitHub +# Release for that tag. + +name: Build wheels + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+*" + pull_request: + paths: + - ".github/workflows/wheels.yml" + workflow_dispatch: + +jobs: + build_wheels: + name: Wheel ${{ matrix.python }} (manylinux_2_28 x86_64) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: ["cp39", "cp310", "cp311", "cp312", "cp313"] + + steps: + - uses: actions/checkout@v4 + with: + # versioneer derives the version from `git describe`, which needs + # the full history and the tags. + fetch-depth: 0 + fetch-tags: true + + - name: Build wheel + uses: pypa/cibuildwheel@v2.23.3 + env: + CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64 + CIBW_ARCHS_LINUX: x86_64 + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 + CIBW_BEFORE_BUILD: pip install cmake + # Smoke test: every compiled module must import from the repaired + # wheel, outside the source tree. + CIBW_TEST_COMMAND: >- + python -c "import pyace, pyace.sharmonics, pyace.coupling, pyace.basis, pyace.evaluator, pyace.catomicenvironment, pyace.calculator; print(pyace.__version__)" + + - uses: actions/upload-artifact@v4 + with: + name: wheels-${{ matrix.python }} + path: wheelhouse/*.whl + + build_sdist: + name: Source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: pipx run build --sdist + - uses: actions/upload-artifact@v4 + with: + name: sdist + path: dist/*.tar.gz + + release: + name: Attach to GitHub Release + needs: [build_wheels, build_sdist] + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + - uses: softprops/action-gh-release@v2 + with: + files: dist/* diff --git a/docs/pacemaker/install.md b/docs/pacemaker/install.md index 9edc715..7d9b60e 100644 --- a/docs/pacemaker/install.md +++ b/docs/pacemaker/install.md @@ -77,7 +77,16 @@ python setup.py install The `pyace` (aka `python-ace`) package is located in [this repository](https://github.com/ICAMS/python-ace). It contains the `pacemaker` tools and other Python wrappers and utilities. -To install `pyace`: +Prebuilt binary wheels (manylinux_2_28, x86_64, CPython 3.9-3.13) are attached to every +[GitHub release](https://github.com/pmrv/python-ace/releases). If one matches your platform, +you can skip compiling the C++ extensions: +``` +pip install https://github.com/pmrv/python-ace/releases/download//.whl +``` +Wheels for untagged commits can be built on demand with the "Build wheels" workflow under +the repository's Actions tab and downloaded from the workflow run. + +To install `pyace` from source: * Download `pyace` from [this repository](https://github.com/ICAMS/python-ace). Clone with ```