From 67732db5828eaf9691053b4b841dbf1f008354f5 Mon Sep 17 00:00:00 2001 From: Min RK Date: Mon, 25 Aug 2025 15:28:54 -0700 Subject: [PATCH 1/7] allow stable abi builds --- python/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 48b0d40af..4b78353be 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -20,7 +20,7 @@ else() find_package(Basix REQUIRED) endif() -find_package(Python COMPONENTS Interpreter Development.Module REQUIRED) +find_package(Python COMPONENTS Interpreter Development.Module ${SKBUILD_SABI_COMPONENT} REQUIRED) # Options include(FeatureSummary) @@ -38,7 +38,10 @@ list(APPEND CMAKE_PREFIX_PATH "${NB_DIR}") find_package(nanobind CONFIG REQUIRED) # Create the binding library -nanobind_add_module(_basixcpp NB_SUPPRESS_WARNINGS wrapper.cpp) +if(NOT "${SKBUILD_SABI_VERSION}" STREQUAL "") + set(NANOBIND_SABI "STABLE_ABI") +endif() +nanobind_add_module(_basixcpp NB_SUPPRESS_WARNINGS ${NANOBIND_SABI} wrapper.cpp) target_compile_definitions(_basixcpp PRIVATE cxx_std_20) if(ENABLE_CLANG_TIDY) From 8238d6fe8befc9a498f7b10fa52c6691f5f7843c Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Mon, 1 Sep 2025 10:18:47 +0200 Subject: [PATCH 2/7] Try cibuildwheel making abi3 images for 3.12 (and therefore 3.13). --- pyproject.toml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 45a0da22c..d9e91c186 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,12 +34,13 @@ testpaths = ["test"] wheel.packages = ["python/basix"] [tool.cibuildwheel] +build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=3.12"] } build = [ - "cp{39,310,311,312}-manylinux_x86_64", - "cp{39,310,311,312}-manylinux_aarch64", - "cp{39,310,311,312}-macosx_x86_64", - "cp{39,310,311,312}-macosx_arm64", - "cp{39,310,311,312}-win_amd64", + "cp{39,310,311,312,313}-manylinux_x86_64", + "cp{39,310,311,312,313}-manylinux_aarch64", + "cp{39,310,311,312,313}-macosx_x86_64", + "cp{39,310,311,312,313}-macosx_arm64", + "cp{39,310,311,312,313}-win_amd64", ] test-command = [ "cmake -G Ninja -DPython3_EXECUTABLE=$(which python) -B build-dir -S {project}/test/test_cmake", @@ -50,11 +51,11 @@ test-command = [ test-requires = ["pytest-xdist"] test-extras = ["test"] test-skip = "*-*linux_aarch64" -manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:2024-09-16-ab73a4b" -manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:2024-09-16-ab73a4b" +manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:2025.08.29-1" +manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:2025.08.29-1" [tool.cibuildwheel.windows] -build-frontend = {name = "pip", args = ["--config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON", "--config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"] } +build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=3.12", "--config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON", "--config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"] } test-command = [ "python -m pytest -v -n auto --durations 20 {project}/test/", ] From 588d120c074904f8b54d818f6f5f9d3373063d2e Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Mon, 1 Sep 2025 10:35:38 +0200 Subject: [PATCH 3/7] Try again. --- pyproject.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d9e91c186..95641ce49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,13 +34,13 @@ testpaths = ["test"] wheel.packages = ["python/basix"] [tool.cibuildwheel] -build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=3.12"] } +build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=cp312"} build = [ - "cp{39,310,311,312,313}-manylinux_x86_64", - "cp{39,310,311,312,313}-manylinux_aarch64", - "cp{39,310,311,312,313}-macosx_x86_64", - "cp{39,310,311,312,313}-macosx_arm64", - "cp{39,310,311,312,313}-win_amd64", + "cp3{9,10,11,12,13}-manylinux_x86_64", + "cp3{9,10,11,12,13}-manylinux_aarch64", + "cp3{9,10,11,12,13}-macosx_x86_64", + "cp3{9,10,11,12,13}-macosx_arm64", + "cp3{9,10,11,12,13}-win_amd64", ] test-command = [ "cmake -G Ninja -DPython3_EXECUTABLE=$(which python) -B build-dir -S {project}/test/test_cmake", @@ -55,7 +55,7 @@ manylinux-x86_64-image = "quay.io/pypa/manylinux_2_28_x86_64:2025.08.29-1" manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:2025.08.29-1" [tool.cibuildwheel.windows] -build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=3.12", "--config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON", "--config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"] } +build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=cp312", "--config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON", "--config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"] } test-command = [ "python -m pytest -v -n auto --durations 20 {project}/test/", ] From 6df1e512571f6fa88960a55e944c8c9e325521e9 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Mon, 1 Sep 2025 10:38:05 +0200 Subject: [PATCH 4/7] Fix. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 95641ce49..e90c78329 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ testpaths = ["test"] wheel.packages = ["python/basix"] [tool.cibuildwheel] -build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=cp312"} +build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=cp312"] } build = [ "cp3{9,10,11,12,13}-manylinux_x86_64", "cp3{9,10,11,12,13}-manylinux_aarch64", From 2e14668ac7af85f0b777987db01d51e97feedec1 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Mon, 1 Sep 2025 11:03:02 +0200 Subject: [PATCH 5/7] Remove verbose, shift to more recent macOS builders. --- .github/workflows/build-wheels.yml | 2 +- pyproject.toml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 2da00dfca..7b4de823b 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -40,7 +40,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-13, macos-14, windows-2022] + os: [ubuntu-latest, macos-14, macos-15, windows-2025] steps: - uses: actions/checkout@v5 diff --git a/pyproject.toml b/pyproject.toml index e90c78329..69ce1cecc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ test-command = [ "cmake -G Ninja -DPython3_EXECUTABLE=$(which python) -B build-dir -S {project}/test/test_cmake", "cmake --build build-dir/", "build-dir/a.out", - "python -m pytest -v -n auto --durations 20 {project}/test/", + "python -m pytest -n auto --durations 20 {project}/test/", ] test-requires = ["pytest-xdist"] test-extras = ["test"] @@ -57,7 +57,7 @@ manylinux-aarch64-image = "quay.io/pypa/manylinux_2_28_aarch64:2025.08.29-1" [tool.cibuildwheel.windows] build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=cp312", "--config-settings=cmake.args=-DINSTALL_RUNTIME_DEPENDENCIES=ON", "--config-settings=cmake.args=-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake"] } test-command = [ - "python -m pytest -v -n auto --durations 20 {project}/test/", + "python -m pytest -n auto --durations 20 {project}/test/", ] [tool.cibuildwheel.linux] @@ -70,7 +70,7 @@ test-command = [ "cmake -G Ninja -DPython3_EXECUTABLE=$(which python) -B build-dir -S {project}/test/test_cmake", "cmake --build build-dir/", "build-dir/a.out", - "python -m pytest -v -n auto --durations 20 {project}/test/", + "python -m pytest -n auto --durations 20 {project}/test/", ] [tool.cibuildwheel.macos] @@ -84,7 +84,7 @@ test-command = [ "cmake -G Ninja -DPython3_EXECUTABLE=$(which python) -B build-dir -S {project}/test/test_cmake", "cmake --build build-dir/", "build-dir/a.out", - "python -m pytest -v -n auto --durations 20 {project}/test/", + "python -m pytest -n auto --durations 20 {project}/test/", ] [tool.mypy] From 12c335db1c480c7bb6a34d8ba77db96dd88d88a0 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Mon, 1 Sep 2025 12:40:07 +0200 Subject: [PATCH 6/7] Try abi3audit --- pyproject.toml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 69ce1cecc..0e69c892c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,11 +36,11 @@ wheel.packages = ["python/basix"] [tool.cibuildwheel] build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=cp312"] } build = [ - "cp3{9,10,11,12,13}-manylinux_x86_64", - "cp3{9,10,11,12,13}-manylinux_aarch64", - "cp3{9,10,11,12,13}-macosx_x86_64", - "cp3{9,10,11,12,13}-macosx_arm64", - "cp3{9,10,11,12,13}-win_amd64", + "cp3{12,13}-manylinux_x86_64", + "cp3{12,13}-manylinux_aarch64", + "cp3{12,13}-macosx_x86_64", + "cp3{12,13}-macosx_arm64", + "cp3{12,13}-win_amd64", ] test-command = [ "cmake -G Ninja -DPython3_EXECUTABLE=$(which python) -B build-dir -S {project}/test/test_cmake", @@ -59,6 +59,10 @@ build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=cp312", test-command = [ "python -m pytest -n auto --durations 20 {project}/test/", ] +repair-wheel-command = [ + "copy {wheel} {dest_dir}", + "pipx run abi3audit --strict --report {wheel}", +] [tool.cibuildwheel.linux] archs = [ @@ -72,6 +76,10 @@ test-command = [ "build-dir/a.out", "python -m pytest -n auto --durations 20 {project}/test/", ] +repair-wheel-command = [ + "auditwheel repair -w {dest_dir} {wheel}", + "pipx run abi3audit --strict --report {wheel}", +] [tool.cibuildwheel.macos] environment = { "MACOSX_DEPLOYMENT_TARGET" = "10.14" } @@ -86,6 +94,10 @@ test-command = [ "build-dir/a.out", "python -m pytest -n auto --durations 20 {project}/test/", ] +repair-wheel-command = [ + "delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}", + "pipx run abi3audit --strict --report {wheel}", +] [tool.mypy] ignore_missing_imports = true From e2c36ba3bb081c8b20c3d51ebbac8d4e702c3a6f Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Mon, 1 Sep 2025 12:52:40 +0200 Subject: [PATCH 7/7] Add back in older versions. --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0e69c892c..8a4d9b54b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,11 +36,11 @@ wheel.packages = ["python/basix"] [tool.cibuildwheel] build-frontend = {name = "pip", args = ["--config-settings=wheel.py-api=cp312"] } build = [ - "cp3{12,13}-manylinux_x86_64", - "cp3{12,13}-manylinux_aarch64", - "cp3{12,13}-macosx_x86_64", - "cp3{12,13}-macosx_arm64", - "cp3{12,13}-win_amd64", + "cp3{9,10,11,12,13}-manylinux_x86_64", + "cp3{9,10,11,12,13}-manylinux_aarch64", + "cp3{9,10,11,12,13}-macosx_x86_64", + "cp3{9,10,11,12,13}-macosx_arm64", + "cp3{9,10,11,12,13}-win_amd64", ] test-command = [ "cmake -G Ninja -DPython3_EXECUTABLE=$(which python) -B build-dir -S {project}/test/test_cmake",