From 2bc8c99975b0d7eefb5f014a484b22c6cbf224a2 Mon Sep 17 00:00:00 2001 From: Jack Lovell Date: Wed, 29 Jul 2026 08:27:09 -0400 Subject: [PATCH 1/3] Set minimum supported python to 3.9 --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 952cfbbe..c07eaff8 100644 --- a/setup.py +++ b/setup.py @@ -115,6 +115,8 @@ ), long_description=long_description, long_description_content_type="text/markdown", + # Support Python versions where Raysect wheels are available. + requires_python=">=3.9", install_requires=[ "numpy>=2.0", "scipy", From 964c79e3c64f1fca0a69519d73d124a73b2e04f7 Mon Sep 17 00:00:00 2001 From: Jack Lovell Date: Thu, 27 Aug 2026 11:54:28 -0400 Subject: [PATCH 2/3] Add an action to build distributions on tagged releases Use the CIbuildwheel Github action to build wheels for all currently-supported Python versions. Manylinux wheels are produced, using the manylinux2014 image where possible (to support JET/UKAEA computers which still run SL7), with manylinux_2_28 for Python 3.14 as that isn't available in manylinux2014. Only Linux wheels are built for now: MacOS (and Windows should Raysect ever support it) are deferred. But the strategy matrix for the wheels is written in such a way as to easily add other OS's or architectures later as necessary. To avoid wasting compute cycles, the workflow is configured to only run on tagged pushes: we manually tag RC and stable releases so should only get distributions on these versions. If necessary, tagging a development version with an M.m.p.dev version can also trigger a build. Automatic uploading to PyPI is not implemented: the distribution files should be downloaded from the `gather_artifacts` job's artifacts and checked locally before uploading to PyPI. This is to reduce the risk of uploading broken distributions: if the process proves robust and reliable then automatic uploading to PyPI can be revisited. Addresses one of the items in #507 --- .github/workflows/build.yml | 78 +++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..f2954daa --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,78 @@ +name: Build wheels + +# We don't want to spend CI compute cycles on every commit, so restrict building +# of wheels to releases and candidate releases. These are releases which will be +# tagged manually with a vM.m.p[.rcN] version. +# Builds can also be triggered by tagging with a .dev version. +on: + push: + tags: + - 'v*' + +jobs: + # Build a wheel for each Python version in a separate parallel job. + build_wheels: + name: Build wheels for ${{ matrix.py }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] # Only Linux for now, passive provision for other OS's. + python: [cp39, cp310, cp311, cp312, cp313, cp314] + + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: Build wheels + uses: pypa/cibuildwheel@v4.2.0 + env: + CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64 + # Build on manylinux2014 where possible for greatest compatibility, + # but need newer manylinux_2_28 for Python 3.14 + CIBW_MANYLINUX_X86_64_IMAGE: >- + ${{ contains(matrix.python, 'cp314') && 'manylinux_2_28' || 'manylinux2014' }} + # Avoid trying to compile e.g. Pillow (raysect->matplotlib dependency) from + # source on older manylinux with newer Python. An old version is fine. + CIBW_ENVIRONMENT: 'PIP_PREFER_BINARY=1' + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ matrix.python }} + path: ./wheelhouse/*.whl + + make_sdist: + name: Make SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + + # Wheels are built in parallel jobs: gather the outputs into a single artifact + # for more convenient retrieval. At some stage we may consider automatic + # upload to PyPI from this job (since its `needs` entry ensures the SDist and + # wheels all built successfully). + gather_artifacts: + name: Gather SDist and wheel outputs into a single artifact + runs-on: ubuntu-latest + needs: [build_wheels, make_sdist] + steps: + - uses: actions/download-artifact@v5 + with: + pattern: cibw* + path: dist + merge-multiple: true + + - uses: actions/upload-artifact@v4 + with: + name: artifacts + path: dist/* From bab59b6f3dd41fb5049b7e222bfe2a9c50afe427 Mon Sep 17 00:00:00 2001 From: Jack Lovell Date: Thu, 27 Aug 2026 12:05:28 -0400 Subject: [PATCH 3/3] Bump version to 1.6.0.dev3 Tag this commit to check the Cibuildwheel action. --- cherab/core/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cherab/core/VERSION b/cherab/core/VERSION index 8a3469e1..3c364a6a 100644 --- a/cherab/core/VERSION +++ b/cherab/core/VERSION @@ -1 +1 @@ -1.6.0.dev2 +1.6.0.dev3