The abi3t stable ABI allows a single wheel (tagged abi3.abi3t) to support both GIL-enabled and free-threaded CPython 3.15 and later.
To target abi3t, you must use a free-threaded interpreter for the build and set the limited_api version to '3.15' or later. You can detect if a build is free-threaded by checking the Py_GIL_DISABLED sysconfig variable (which returns 1 for free-threaded builds).
py = import('python').find_installation(pure: false)
limited_api = '3.10'
if py.language_version().version_compare('>=3.15')
if py.get_variable('Py_GIL_DISABLED') == 1
limited_api = '3.15'
endif
endif
py.extension_module(
'_core',
'_core.c',
limited_api: limited_api,
install: true,
subdir: 'example',
)