From 9a329cb996fa97cc5e42c9c5a8aabe69b2cff2d3 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 3 Jul 2026 15:36:59 +0100 Subject: [PATCH 1/3] Add stable ABI wheels for CPython 3.10+ These wheels run slower so we still include native wheels for Python 3.13 and 3.14. --- .github/workflows/buildwheel.yml | 21 +++++++++++++-------- README.md | 4 ++-- bin/cibw.bat | 6 +++++- doc/source/build.rst | 2 +- doc/source/install.rst | 6 +++--- meson.options | 2 +- pyproject.toml | 11 ++++++++++- 7 files changed, 35 insertions(+), 17 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index 0134b6ae..a6a7e913 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -16,6 +16,8 @@ env: PYODIDE_EMSCRIPTEN_VERSION: '5.0.3' PYODIDE_PYTHON_VERSION: '3.14' PYODIDE_CIBW_BUILD: 'cp314-*' + NATIVE_CIBW_BUILD: 'cp313-* cp314-* cp314t-* pp311-*' + STABLE_ABI_CIBW_BUILD: 'cp310-*' jobs: build_wheels: @@ -31,37 +33,31 @@ jobs: kind: native artifact_name: wheels-ubuntu-22.04 cibw_platform: auto - cibw_build: "*" - name: Build manylinux arm64 wheels os: ubuntu-22.04-arm kind: native artifact_name: wheels-ubuntu-22.04-arm cibw_platform: auto - cibw_build: "*" - name: Build Windows x86-64 wheels os: windows-2022 kind: native artifact_name: wheels-windows-2022 cibw_platform: auto - cibw_build: "*" - name: Build Windows arm64 wheels os: windows-11-arm kind: native artifact_name: wheels-windows-11-arm cibw_platform: auto - cibw_build: "*" - name: Build macOS x86-64 wheels os: macos-15-intel kind: native artifact_name: wheels-macos-15-intel cibw_platform: auto - cibw_build: "*" - name: Build macOS arm64 wheels os: macos-14 kind: native artifact_name: wheels-macos-14 cibw_platform: auto - cibw_build: "*" - name: Build Pyodide wheels os: ubuntu-22.04 kind: pyodide @@ -120,11 +116,20 @@ jobs: uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 env: CIBW_PLATFORM: ${{ matrix.cibw_platform }} - CIBW_BUILD: ${{ matrix.kind == 'pyodide' && env.PYODIDE_CIBW_BUILD || matrix.cibw_build }} + CIBW_BUILD: ${{ matrix.kind == 'pyodide' && env.PYODIDE_CIBW_BUILD || env.NATIVE_CIBW_BUILD }} CIBW_PYODIDE_VERSION: ${{ env.PYODIDE_VERSION }} # override setting in pyproject.toml to use msys2 instead of msys64 bash CIBW_BEFORE_ALL_WINDOWS: ${{ matrix.os == 'windows-11-arm' && 'msys2 -c bin/cibw_before_all_windows_arm64.sh' || 'msys2 -c bin/cibw_before_all_windows_amd64.sh' }} + - name: Build stable ABI wheels + if: ${{ matrix.kind == 'native' }} + uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 + env: + CIBW_PLATFORM: ${{ matrix.cibw_platform }} + CIBW_BUILD: ${{ env.STABLE_ABI_CIBW_BUILD }} + # override setting in pyproject.toml to use msys2 instead of msys64 bash + CIBW_BEFORE_ALL_WINDOWS: ${{ matrix.os == 'windows-11-arm' && 'msys2 -c bin/cibw_before_all_windows_arm64.sh' || 'msys2 -c bin/cibw_before_all_windows_amd64.sh' }} + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ matrix.artifact_name }} @@ -172,7 +177,7 @@ jobs: macos-15, ] # This list to be kept in sync with python-requires in pyproject.toml. - python-version: ['3.11', '3.12', '3.13', '3.14', '3.14t', 'pypy3.11'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15', 'pypy3.11'] exclude: - os: windows-11-arm python-version: pypy3.11 diff --git a/README.md b/README.md index db71dfae..83e0d14c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Author: Fredrik Johansson Installation ------------ -Currently python-flint supports CPython versions 3.11-3.14 and 3.14t +Currently python-flint supports CPython versions 3.10-3.14 and 3.14t (free-threaded) and provides binaries on PyPI for the following platforms: - Windows (x86-64) @@ -144,7 +144,7 @@ Compatible versions: | python-flint | Release date | CPython | FLINT | Cython | |--------------|---------------|-------------|------------|------------------| -| `0.9.0` | ??? | `3.11-3.14` | `3.0-3.6` | `3.1-3.2?` | +| `0.9.0` | ??? | `3.10-3.14` | `3.0-3.6` | `3.1-3.2?` | | `0.8.0` | 29th Aug 2025 | `3.11-3.14` | `3.0-3.3` | `3.1` only | | `0.7.0` | 16th Mar 2025 | `3.11-3.13` | `3.0-3.2` | `3.0.11-3.1.0a1` | | `0.6.0` | 1st Feb 2024 | `3.9-3.12` | `3.0` only | `3.0` only | diff --git a/bin/cibw.bat b/bin/cibw.bat index 8f62e8e9..431a7ec2 100644 --- a/bin/cibw.bat +++ b/bin/cibw.bat @@ -22,6 +22,10 @@ rem del /q wheelhouse\* rem override setting in pyproject.toml -set CIBW_BUILD=cp39-* cp310-* cp311-* +set CIBW_BUILD=cp313-* cp314-* cp314t-* pp311-* + +cibuildwheel --platform windows + +set CIBW_BUILD=cp310-* cibuildwheel --platform windows diff --git a/doc/source/build.rst b/doc/source/build.rst index 356bb925..e944aaf7 100644 --- a/doc/source/build.rst +++ b/doc/source/build.rst @@ -86,7 +86,7 @@ Compatible versions: - Cython * - 0.9.0 - Not yet - - 3.11-3.14 + - 3.10-3.14 - 3.0-3.6 - 3.1-3.2? * - 0.8.0 diff --git a/doc/source/install.rst b/doc/source/install.rst index 6e4ccef8..210eda62 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -47,9 +47,9 @@ Fully supported platforms Generally each release of python-flint will be compatible with a range of Python versions as described in `SPEC 0 -`_. At the time of writing, the -current release of ``python-flint`` is ``0.6.0`` and binaries are provided for -Python 3.9, 3.10 3.11 and 3.12 for the following platforms: +`_. At the time of writing, +binaries are provided for CPython 3.10-3.14 and PyPy 3.11 for the following +platforms: - Windows 64-bit (``x86_64``) - MacOS 64-bit Intel and 64-bit ARM (i.e. Apple Silicon) diff --git a/meson.options b/meson.options index d1094d31..5a3d4781 100644 --- a/meson.options +++ b/meson.options @@ -1,4 +1,4 @@ option('coverage', type : 'boolean', value : false, description : 'enable coverage build') option('add_flint_rpath', type : 'boolean', value : false) option('flint_version_check', type: 'boolean', value : true) -option('limited_api_version', type: 'string', value : '3.12') +option('limited_api_version', type: 'string', value : '3.10') diff --git a/pyproject.toml b/pyproject.toml index 3056fdd0..d640eaae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ description = "Bindings for FLINT" version = "0.8.0" # This needs to be in sync with README, and CI config. -requires-python = ">= 3.11" +requires-python = ">= 3.10" authors = [ {name = "Fredrik Johansson", email = "fredrik.johansson@gmail.com"}, {name = "Oscar Benjamin", email = "oscar.j.benjamin@gmail.com"}, @@ -107,6 +107,15 @@ manylinux-x86_64-image = "manylinux2014" manylinux-aarch64-image = "manylinux_2_28" manylinux-i686-image = "manylinux2014" +[[tool.cibuildwheel.overrides]] +select = ["cp310-*linux_*", "cp310-macosx_*"] +config-settings = {setup-args = "-Dpython.allow_limited_api=true"} + +[[tool.cibuildwheel.overrides]] +select = "cp310-win_*" +inherit.config-settings = "append" +config-settings = {setup-args = ["--vsenv", "-Dpython.allow_limited_api=true"]} + [tool.cibuildwheel.linux.environment] # LD_LIBRARY_PATH is needed by auditwheel LD_LIBRARY_PATH = "$(pwd)/.local/lib:$LD_LIBRARY_PATH" From eb51590beeb745b52192cfcb387f9352c0e1e201 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 3 Jul 2026 16:05:16 +0100 Subject: [PATCH 2/3] CI: use separate matrix jobs for abi3 wheels --- .github/workflows/buildwheel.yml | 86 ++++++++++++++++++++++++++------ pyproject.toml | 14 ------ 2 files changed, 72 insertions(+), 28 deletions(-) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index a6a7e913..dbdeb3d6 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -15,9 +15,6 @@ env: PYODIDE_VERSION: '314.0.0' PYODIDE_EMSCRIPTEN_VERSION: '5.0.3' PYODIDE_PYTHON_VERSION: '3.14' - PYODIDE_CIBW_BUILD: 'cp314-*' - NATIVE_CIBW_BUILD: 'cp313-* cp314-* cp314t-* pp311-*' - STABLE_ABI_CIBW_BUILD: 'cp310-*' jobs: build_wheels: @@ -28,48 +25,117 @@ jobs: fail-fast: false matrix: include: + - name: Build manylinux x86-64 wheels os: ubuntu-22.04 kind: native artifact_name: wheels-ubuntu-22.04 cibw_platform: auto + cibw_build: "cp313-* cp314-* cp314t-* pp311-*" + cibw_config_settings: "" + + - name: Build manylinux x86-64 stable ABI wheels + os: ubuntu-22.04 + kind: stable-abi + artifact_name: wheels-ubuntu-22.04-abi3 + cibw_platform: auto + cibw_build: "cp310-*" + cibw_config_settings: "setup-args=-Dpython.allow_limited_api=true" + - name: Build manylinux arm64 wheels os: ubuntu-22.04-arm kind: native artifact_name: wheels-ubuntu-22.04-arm cibw_platform: auto + cibw_build: "cp313-* cp314-* cp314t-* pp311-*" + cibw_config_settings: "" + + - name: Build manylinux arm64 stable ABI wheels + os: ubuntu-22.04-arm + kind: stable-abi + artifact_name: wheels-ubuntu-22.04-arm-abi3 + cibw_platform: auto + cibw_build: "cp310-*" + cibw_config_settings: "setup-args=-Dpython.allow_limited_api=true" + - name: Build Windows x86-64 wheels os: windows-2022 kind: native artifact_name: wheels-windows-2022 cibw_platform: auto + cibw_build: "cp313-* cp314-* cp314t-* pp311-*" + cibw_config_settings: "setup-args=--vsenv build-dir=build" + + - name: Build Windows x86-64 stable ABI wheels + os: windows-2022 + kind: stable-abi + artifact_name: wheels-windows-2022-abi3 + cibw_platform: auto + cibw_build: "cp310-*" + cibw_config_settings: "setup-args=--vsenv setup-args=-Dpython.allow_limited_api=true build-dir=build" + - name: Build Windows arm64 wheels os: windows-11-arm kind: native artifact_name: wheels-windows-11-arm cibw_platform: auto + cibw_build: "cp313-* cp314-* cp314t-* pp311-*" + cibw_config_settings: "setup-args=--vsenv build-dir=build" + + - name: Build Windows arm64 stable ABI wheels + os: windows-11-arm + kind: stable-abi + artifact_name: wheels-windows-11-arm-abi3 + cibw_platform: auto + cibw_build: "cp310-*" + cibw_config_settings: "setup-args=--vsenv setup-args=-Dpython.allow_limited_api=true build-dir=build" + - name: Build macOS x86-64 wheels os: macos-15-intel kind: native artifact_name: wheels-macos-15-intel cibw_platform: auto + cibw_build: "cp313-* cp314-* cp314t-* pp311-*" + cibw_config_settings: "" + + - name: Build macOS x86-64 stable ABI wheels + os: macos-15-intel + kind: stable-abi + artifact_name: wheels-macos-15-intel-abi3 + cibw_platform: auto + cibw_build: "cp310-*" + cibw_config_settings: "setup-args=-Dpython.allow_limited_api=true" + - name: Build macOS arm64 wheels os: macos-14 kind: native artifact_name: wheels-macos-14 cibw_platform: auto + cibw_build: "cp313-* cp314-* cp314t-* pp311-*" + cibw_config_settings: "" + + - name: Build macOS arm64 stable ABI wheels + os: macos-14 + kind: stable-abi + artifact_name: wheels-macos-14-abi3 + cibw_platform: auto + cibw_build: "cp310-*" + cibw_config_settings: "setup-args=-Dpython.allow_limited_api=true" + - name: Build Pyodide wheels os: ubuntu-22.04 kind: pyodide artifact_name: wheels-pyodide cibw_platform: pyodide + cibw_build: "cp314-*" + cibw_config_settings: "build-dir=flint_wasm_build setup-args=-Dflint_version_check=false" steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: persist-credentials: false - - if: ${{ matrix.kind == 'native' }} + - if: ${{ matrix.kind != 'pyodide' }} uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: '3.13' @@ -116,20 +182,12 @@ jobs: uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 env: CIBW_PLATFORM: ${{ matrix.cibw_platform }} - CIBW_BUILD: ${{ matrix.kind == 'pyodide' && env.PYODIDE_CIBW_BUILD || env.NATIVE_CIBW_BUILD }} + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_CONFIG_SETTINGS: ${{ matrix.cibw_config_settings }} CIBW_PYODIDE_VERSION: ${{ env.PYODIDE_VERSION }} # override setting in pyproject.toml to use msys2 instead of msys64 bash CIBW_BEFORE_ALL_WINDOWS: ${{ matrix.os == 'windows-11-arm' && 'msys2 -c bin/cibw_before_all_windows_arm64.sh' || 'msys2 -c bin/cibw_before_all_windows_amd64.sh' }} - - name: Build stable ABI wheels - if: ${{ matrix.kind == 'native' }} - uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 - env: - CIBW_PLATFORM: ${{ matrix.cibw_platform }} - CIBW_BUILD: ${{ env.STABLE_ABI_CIBW_BUILD }} - # override setting in pyproject.toml to use msys2 instead of msys64 bash - CIBW_BEFORE_ALL_WINDOWS: ${{ matrix.os == 'windows-11-arm' && 'msys2 -c bin/cibw_before_all_windows_arm64.sh' || 'msys2 -c bin/cibw_before_all_windows_amd64.sh' }} - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ matrix.artifact_name }} diff --git a/pyproject.toml b/pyproject.toml index d640eaae..9df22119 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,15 +107,6 @@ manylinux-x86_64-image = "manylinux2014" manylinux-aarch64-image = "manylinux_2_28" manylinux-i686-image = "manylinux2014" -[[tool.cibuildwheel.overrides]] -select = ["cp310-*linux_*", "cp310-macosx_*"] -config-settings = {setup-args = "-Dpython.allow_limited_api=true"} - -[[tool.cibuildwheel.overrides]] -select = "cp310-win_*" -inherit.config-settings = "append" -config-settings = {setup-args = ["--vsenv", "-Dpython.allow_limited_api=true"]} - [tool.cibuildwheel.linux.environment] # LD_LIBRARY_PATH is needed by auditwheel LD_LIBRARY_PATH = "$(pwd)/.local/lib:$LD_LIBRARY_PATH" @@ -163,7 +154,6 @@ repair-wheel-command = [ [tool.cibuildwheel.windows] before-build = "pip install wheel delvewheel" -config-settings = {setup-args = ["--vsenv"], build-dir = "build"} repair-wheel-command = [ """python bin/cibw_repair_wheel_licenses.py {wheel} \ --license LGPL-3.0-or-later \ @@ -208,7 +198,3 @@ WASM_LIBRARY_DIR = "$(pwd)/wasm-library-dir" PKG_CONFIG_PATH = "$(pwd)/wasm-library-dir/lib/pkgconfig:$PKG_CONFIG_PATH" CFLAGS = "-I$(pwd)/wasm-library-dir/include $CFLAGS" LDFLAGS = "-L$(pwd)/wasm-library-dir/lib -lflint -lmpfr -lgmp $LDFLAGS" - -[tool.cibuildwheel.pyodide.config-settings] -build-dir = "flint_wasm_build" -setup-args = ["-Dflint_version_check=false"] From e51cd20c327c5611e8002e0ca510ab96ea772017 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Fri, 3 Jul 2026 16:59:33 +0100 Subject: [PATCH 3/3] Skip testing Python 3.10 on Windows ARM The setup-python action cannot install Python 3.10 on Windows ARM. The same abi3 wheels are tested on e.g. 3.11 anyway. --- .github/workflows/buildwheel.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/buildwheel.yml b/.github/workflows/buildwheel.yml index dbdeb3d6..95513eb3 100644 --- a/.github/workflows/buildwheel.yml +++ b/.github/workflows/buildwheel.yml @@ -237,6 +237,8 @@ jobs: # This list to be kept in sync with python-requires in pyproject.toml. python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.14t', '3.15', 'pypy3.11'] exclude: + - os: windows-11-arm + python-version: '3.10' - os: windows-11-arm python-version: pypy3.11