Skip to content

Commit ac986d8

Browse files
authored
Build for limited API only on supported interpreters (#17)
2 parents be367c8 + 15dcc50 commit ac986d8

File tree

3 files changed

+35
-14
lines changed

3 files changed

+35
-14
lines changed

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ Changelog
22
=========
33

44

5+
Unreleased
6+
----------
7+
8+
- Enable thread-free wheels for Python 3.13 and 3.14.
9+
- Enable PYPY 3.11 wheels.
10+
11+
512
2025.11.0 (2025-11-02)
613
----------------------
714

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ build-backend = "setuptools.build_meta"
1111
# configuration below.
1212
enable = ["all"]
1313
# See https://cibuildwheel.pypa.io/en/stable/options/#build-skip
14-
# Not sure why it was failing on PyPy 3.11.
15-
build = "cp38-* pp310-*"
14+
build = "cp38-* pp310-* pp311-* cp313t-* cp314t-*"

setup.py

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import sys
2+
import sysconfig
3+
14
from setuptools import Extension, setup
25
from Cython.Build import cythonize
36

@@ -11,17 +14,29 @@
1114
# 0x030B0000 - Python 3.11 - support typed memoryviews.
1215
# 0x030C0000 - Python 3.12 - support vectorcall (performance improvement).
1316

17+
py_limited_api_kwargs = {}
18+
bdist_wheel_kwargs = {}
19+
if sys.implementation.name == "cpython" and not sysconfig.get_config_var(
20+
"Py_GIL_DISABLED"
21+
):
22+
py_limited_api_kwargs = {
23+
"define_macros": [
24+
# For now we are at python 3.8 as we still support 3.10.
25+
("Py_LIMITED_API", 0x03080000),
26+
],
27+
"py_limited_api": True,
28+
}
29+
bdist_wheel_kwargs = {"py_limited_api": "cp38"}
30+
1431
setup(
15-
ext_modules=cythonize([
16-
Extension(
17-
name="raiser",
18-
sources=["cython_test_exception_raiser/raiser.pyx"],
19-
define_macros=[
20-
# For now we are at python 3.8 as we still support 3.10.
21-
("Py_LIMITED_API", 0x03080000),
22-
],
23-
py_limited_api=True
24-
),
25-
]),
26-
options={"bdist_wheel": {"py_limited_api": "cp38"}},
32+
ext_modules=cythonize(
33+
[
34+
Extension(
35+
name="raiser",
36+
sources=["cython_test_exception_raiser/raiser.pyx"],
37+
**py_limited_api_kwargs
38+
),
39+
]
40+
),
41+
options={"bdist_wheel": {**bdist_wheel_kwargs}},
2742
)

0 commit comments

Comments
 (0)