Skip to content

Commit d889829

Browse files
committed
BLD: use the CPython Limited C API, and hence the Stable ABI
This will build an `abi3` wheel per platform, which can be used for multiple (with-GIL) Python interpreter versions.
1 parent b8ddd4d commit d889829

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

meson.build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ project(
33
'c', 'cython',
44
version: '1.10.0.dev0',
55
license: 'MIT',
6-
meson_version: '>= 1.1.0',
6+
meson_version: '>= 1.5.0',
77
default_options: [
88
'buildtype=debugoptimized',
99
'b_ndebug=if-release',
1010
'c_std=c17',
11+
# We default to false here (so produce wheels like cp314), and can opt into
12+
# producing abi3 wheels. The setting in pyproject.toml is
13+
# `limited-api=true`, but this default will ensure it is opt-in:
14+
'python.allow_limited_api=false',
1115
],
1216
)
1317

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ documentation = "https://pywavelets.readthedocs.io/"
6060
config-settings = {setup-args = ["--vsenv"]}
6161
before-build = "bash {project}/util/cibw_before_build_win.sh"
6262

63+
[tool.meson-python]
64+
limited-api = true
6365

6466
[tool.ruff]
6567
line-length = 88

pywt/_extensions/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ foreach pyx_file: pyx_files
106106
py.extension_module(pyx_file[0],
107107
[cython_gen.process(pyx_file[1])],
108108
c_args : c_args,
109+
limited_api: '3.12',
109110
include_directories : 'c',
110111
dependencies : [np_dep, cy_deps],
111112
link_with : libc_wt,

0 commit comments

Comments
 (0)