Commit 872ae39
Build a single abi3 wheel per platform instead of one per version
Set wheel.py-api = "cp311" so scikit-build-core tags the wheel cp311-abi3,
and turn the SKBUILD_SABI_* variables it exports into USE_SABI on each
extension target. USE_SABI defines Py_LIMITED_API, which is what flips
Cython into CYTHON_LIMITED_API mode, and together with WITH_SOABI names the
modules <name>.abi3.so. A plain cmake invocation sets neither variable, so
the version-specific behaviour is unchanged outside of a wheel build.
No .pyx changes were needed. The cdef classes (SChunk, vlmeta) build as
PyType_FromSpec heap types, the legacy `np.ndarray[dtype, ndim=N]` buffer
syntax in indexing_ext still compiles, and utf8_ext's NpyString usage is
limited-API clean, all with Cython 3.2.9 and NumPy 2.5.
Measured on macOS arm64, 4 interleaved runs, min-of-7 per measurement: worst
case 1.013x (compress2 of 8 KB buffers, i.e. call-overhead bound), everything
else within noise. SChunk attribute access -- the most direct probe of the
heap-type path -- came out at 0.987x. Full suite passes on the build
interpreter (3.14) and, using that same wheel, on 3.11/3.12/3.13.
Free-threaded builds keep their own version-specific wheels: scikit-build-core
ignores py-api when Py_GIL_DISABLED is set, so cp314t/cp315t need no extra
configuration. Collapsing those into one wheel needs abi3t (PEP 803), which
starts at 3.15 and requires a PEP 793 module export hook that Cython cannot
emit yet. So this is 7 wheels per platform down to 3, not 2.
Since the abi3 wheel is built only on 3.11 and cibuildwheel tests a wheel just
on the interpreter that produced it, add test_abi3_matrix: it installs the
single wheel on 3.11-3.15 across all three OSes, asserts the .abi3. module is
the one loaded, and runs a slice of the suite. That is also the job that would
catch a future CPython breaking the stable ABI -- the risk abi3 takes on in
exchange for not rebuilding.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent e5250de commit 872ae39
3 files changed
Lines changed: 127 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
53 | 65 | | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
57 | | - | |
| 69 | + | |
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
62 | 74 | | |
63 | | - | |
| 75 | + | |
64 | 76 | | |
65 | 77 | | |
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
69 | 81 | | |
70 | 82 | | |
71 | | - | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
75 | 87 | | |
76 | 88 | | |
77 | | - | |
| 89 | + | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
| |||
195 | 207 | | |
196 | 208 | | |
197 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
198 | 277 | | |
199 | | - | |
| 278 | + | |
200 | 279 | | |
201 | 280 | | |
202 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
31 | 51 | | |
32 | 52 | | |
33 | 53 | | |
| |||
68 | 88 | | |
69 | 89 | | |
70 | 90 | | |
71 | | - | |
| 91 | + | |
72 | 92 | | |
73 | 93 | | |
74 | 94 | | |
75 | 95 | | |
76 | 96 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
80 | 100 | | |
81 | 101 | | |
82 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
122 | 133 | | |
123 | 134 | | |
124 | 135 | | |
| |||
0 commit comments