From 1bde6b830c82918423799099e71b36d11c181550 Mon Sep 17 00:00:00 2001 From: Jake Faulkner Date: Mon, 12 Oct 2026 16:19:18 +1300 Subject: [PATCH 1/2] Build Python 3.15 wheels Bump cibuildwheel to v4.3.1, which ships the final CPython 3.15.0, and add cp315-* to CIBW_BUILD. Drop CIBW_PRERELEASE_PYTHONS: cibuildwheel 3 removed that option, so it has been silently ignored since the move to v4, and 3.15 no longer needs prerelease enabling anyway. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/publish-PyPI.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-PyPI.yml b/.github/workflows/publish-PyPI.yml index 7df022b2..b2b01ae7 100644 --- a/.github/workflows/publish-PyPI.yml +++ b/.github/workflows/publish-PyPI.yml @@ -36,10 +36,9 @@ jobs: targets: x86_64-apple-darwin, aarch64-apple-darwin - name: Build wheels - uses: pypa/cibuildwheel@v4.1.0 + uses: pypa/cibuildwheel@v4.3.1 env: - CIBW_BUILD: cp312-* cp313-* cp314-* - CIBW_PRERELEASE_PYTHONS: True + CIBW_BUILD: cp312-* cp313-* cp314-* cp315-* CIBW_SKIP: "*-musllinux_*" CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_ARCHS_LINUX: "x86_64" From 13a87f135943f2e18da62f484015c913b815a12e Mon Sep 17 00:00:00 2001 From: Jake Faulkner Date: Mon, 12 Oct 2026 16:21:02 +1300 Subject: [PATCH 2/2] Build wheels with meta-ci-action's build-dist.yml@v2.3 Replace the hand-rolled cibuildwheel matrix with the shared reusable workflow. v2.3 runs cibuildwheel 4.3.1, which builds the final CPython 3.15.0 by default, and picks interpreters from requires-python, so new CPython releases need no edits here. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/publish-PyPI.yml | 98 ++++-------------------------- 1 file changed, 13 insertions(+), 85 deletions(-) diff --git a/.github/workflows/publish-PyPI.yml b/.github/workflows/publish-PyPI.yml index b2b01ae7..94556a4a 100644 --- a/.github/workflows/publish-PyPI.yml +++ b/.github/workflows/publish-PyPI.yml @@ -12,99 +12,27 @@ on: type: string jobs: - build-wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.tag_name || github.ref }} - fetch-depth: 0 - - - name: Set up Rust - uses: dtolnay/rust-toolchain@stable - - - name: Add macOS Rust targets - if: runner.os == 'macOS' - uses: dtolnay/rust-toolchain@stable - with: - targets: x86_64-apple-darwin, aarch64-apple-darwin - - - name: Build wheels - uses: pypa/cibuildwheel@v4.3.1 - env: - CIBW_BUILD: cp312-* cp313-* cp314-* cp315-* - CIBW_SKIP: "*-musllinux_*" - CIBW_ARCHS_MACOS: "x86_64 arm64" - CIBW_ARCHS_LINUX: "x86_64" - CIBW_ARCHS_WINDOWS: "AMD64" - # cibuildwheel runs the linux versions only inside a - # container. This means we need to install rust inside that - # container before we go ahead and build. - CIBW_BEFORE_ALL_LINUX: > - curl https://sh.rustup.rs -sSf | sh -s -- -y && - source "$HOME/.cargo/env" - CIBW_ENVIRONMENT_LINUX: PATH="$PATH:$HOME/.cargo/bin" - - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: python-package-distributions-${{ matrix.os }} - path: ./wheelhouse/*.whl - - build-sdist: - name: Build source distribution - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ inputs.tag_name || github.ref }} - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install build - run: python -m pip install build - - - name: Build sdist - run: python -m build --sdist - - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: python-package-distributions-sdist - path: dist/*.tar.gz + # sdist plus a cibuildwheel matrix (Linux, macOS, Windows) over every CPython + # that requires-python allows. See ucgmsim/meta-ci-action's README. + build: + uses: ucgmsim/meta-ci-action/.github/workflows/build-dist.yml@v2.3 + with: + ref: ${{ inputs.tag_name }} # empty on a release: builds the release tag + # Only GIL-enabled CPythons: free-threaded (*t-*) wheels are not built. + cibw-skip: "pp* *-musllinux_* *t-*" publish-to-pypi: name: Publish to PyPI - needs: - - build-wheels - - build-sdist + needs: build runs-on: ubuntu-latest - environment: name: pypi url: https://pypi.org/p/im-calculation - permissions: id-token: write - steps: - - name: Download all the dists - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: - pattern: python-package-distributions-* - path: dist - merge-multiple: true - - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@v1.13.0 + name: ${{ needs.build.outputs.artifact-name }} + path: dist/ + - uses: pypa/gh-action-pypi-publish@v1.13.0