Skip to content

Commit 48f795a

Browse files
committed
Enable stable ABI
1 parent 04ab13a commit 48f795a

2 files changed

Lines changed: 12 additions & 9 deletions

File tree

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,12 @@ convention = "numpy"
180180
[tool.scikit-build]
181181
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
182182
cmake.source-dir = "src"
183+
wheel.py-api = "cp312"
184+
185+
[tool.cibuildwheel]
186+
build = "cp311-* cp312-*"
187+
archs = "auto"
188+
build-frontend = "build[uv]"
189+
190+
[tool.cibuildwheel.macos]
191+
environment = { MACOSX_DEPLOYMENT_TARGET="10.13" }

src/CMakeLists.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
cmake_minimum_required(VERSION 3.15...3.26)
1+
cmake_minimum_required(VERSION 3.26)
22
project(
33
"${SKBUILD_PROJECT_NAME}"
44
LANGUAGES CXX
55
VERSION "${SKBUILD_PROJECT_VERSION}")
66

7-
if (CMAKE_VERSION VERSION_LESS 3.18)
8-
set(DEV_MODULE Development)
9-
else()
10-
set(DEV_MODULE Development.Module)
11-
endif()
12-
13-
find_package(Python 3.11 COMPONENTS Interpreter ${DEV_MODULE} REQUIRED)
7+
find_package(Python 3.11 COMPONENTS Interpreter Development.Module ${SKBUILD_SABI_COMPONENT} REQUIRED)
148

159
# Default to "Release" build type unless specified,
1610
# recommended by nanobind docs
@@ -25,7 +19,7 @@ execute_process(
2519
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE nanobind_ROOT)
2620
find_package(nanobind CONFIG REQUIRED)
2721

28-
nanobind_add_module(_calc_mod calcmod.cpp)
22+
nanobind_add_module(_calc_mod STABLE_ABI calcmod.cpp)
2923

3024
target_compile_definitions(_calc_mod
3125
PRIVATE VERSION_INFO=${PROJECT_VERSION})

0 commit comments

Comments
 (0)