From 75e61b085265e6d38ea4be5448f0e296c8ef1099 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Fr=C3=B6jdh?= Date: Fri, 9 Oct 2026 22:25:52 +0200 Subject: [PATCH] Build the Python extension only for 3.14 outside pushes to main and releases Pull requests and branch pushes build the extension for Python 3.14 only. Pushes to main and published releases keep building 3.12, 3.13 and 3.14: wheels skip the older versions via CIBW_SKIP, the conda PR build passes --python 3.14, and the Windows cmake build gets a python-version matrix. The docs build moves from 3.12 to 3.14. --- .github/workflows/build_conda.yml | 4 +++- .github/workflows/build_wheel.yml | 4 ++++ .github/workflows/build_windows.yml | 9 ++++++++- .github/workflows/build_with_docs.yml | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_conda.yml b/.github/workflows/build_conda.yml index 27f076df..43b33821 100644 --- a/.github/workflows/build_conda.yml +++ b/.github/workflows/build_conda.yml @@ -39,6 +39,8 @@ jobs: - name: Disable upload run: conda config --set anaconda_upload no + # Pull requests build only the newest Python; pushes to main build + # every version listed in conda-recipe/conda_build_config.yaml - name: Build - run: conda-build conda-recipe + run: conda-build conda-recipe ${{ !(github.event_name == 'push' && github.ref == 'refs/heads/main') && '--python 3.14' || '' }} diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index d27abd6a..40d27e36 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -43,6 +43,10 @@ jobs: # statistics are printed after each wheel since the host cannot see them. - name: Build wheels env: + # Pull requests and manual runs build only the newest Python; pushes + # to main and releases build every version listed in pyproject.toml + CIBW_SKIP: >- + ${{ !(github.event_name == 'release' || (github.event_name == 'push' && github.ref == 'refs/heads/main')) && 'cp312-* cp313-*' || '' }} CIBW_ENVIRONMENT_WINDOWS: CMAKE_GENERATOR=Ninja CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- auditwheel repair -w {dest_dir} {wheel} && sccache --show-stats diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index 1a562f39..f610f6ec 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -9,6 +9,13 @@ jobs: build: runs-on: windows-latest + strategy: + fail-fast: false + matrix: + # Pushes to main build and test every supported Python; other runs + # only the newest + python-version: ${{ fromJSON((github.event_name == 'push' && github.ref == 'refs/heads/main') && '["3.12", "3.13", "3.14"]' || '["3.14"]') }} + env: # sccache keeps compiled objects in the GitHub Actions cache, so later # runs only recompile the translation units a change affects @@ -19,7 +26,7 @@ jobs: - uses: actions/setup-python@v7 with: - python-version: "3.12" + python-version: ${{ matrix.python-version }} - name: Install Python dependencies run: python -m pip install ninja numpy matplotlib pytest pytest-check boost-histogram diff --git a/.github/workflows/build_with_docs.yml b/.github/workflows/build_with_docs.yml index 9e2dc872..451d580e 100644 --- a/.github/workflows/build_with_docs.yml +++ b/.github/workflows/build_with_docs.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: platform: [ubuntu-latest, macos-latest] - python-version: ["3.12",] + python-version: ["3.14",] runs-on: ${{ matrix.platform }}