Skip to content

Commit 06f3d8b

Browse files
committed
* python/pyproject.toml: Set py_limited_api here for abi3 wheels.
* python/setup.py: Remove wheel setup.
1 parent 3a059f4 commit 06f3d8b

2 files changed

Lines changed: 5 additions & 19 deletions

File tree

python/pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ package-dir = { "" = "src" }
8080
"*" = [ "*.c", "*.h" ]
8181
"moocore.data" = [ "*.txt", "*.dat", "*.xz", "*.csv", "*.10" ]
8282

83+
[tool.distutils.bdist_wheel]
84+
py_limited_api = "cp310"
85+
8386
[tool.cibuildwheel]
8487
skip = [
8588
"*_ppc64le",

python/setup.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
# ruff: noqa: D100, D101, D102, N801
1+
# ruff: noqa: D100
22
from setuptools import setup
3-
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
43

5-
6-
class bdist_wheel_abi3(_bdist_wheel):
7-
def finalize_options(self):
8-
_bdist_wheel.finalize_options(self)
9-
# Automatically detect py_limited_api from extension modules
10-
if not self.py_limited_api:
11-
for ext in self.distribution.ext_modules or []:
12-
if getattr(ext, "py_limited_api", False):
13-
# Use cp310 as the minimum Python version for abi3
14-
self.py_limited_api = "cp310"
15-
break
16-
17-
18-
setup(
19-
cffi_modules=["src/moocore/_ffi_build.py:ffibuilder"],
20-
cmdclass={"bdist_wheel": bdist_wheel_abi3},
21-
)
4+
setup(cffi_modules=["src/moocore/_ffi_build.py:ffibuilder"])

0 commit comments

Comments
 (0)