Skip to content

Commit 8df185a

Browse files
committed
Prevent abi3 from being used with no-GIL interpreter
1 parent 7aa30d0 commit 8df185a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

setuptools/command/bdist_wheel.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from wheel.wheelfile import WheelFile
2727

2828
from .. import Command, __version__
29+
from ..warnings import SetuptoolsWarning
2930
from .egg_info import egg_info as egg_info_cls
3031

3132
from distutils import log
@@ -279,6 +280,15 @@ def finalize_options(self) -> None:
279280
):
280281
raise ValueError(f"py-limited-api must match '{PY_LIMITED_API_PATTERN}'")
281282

283+
if "t" in sys.abiflags:
284+
SetuptoolsWarning.emit(
285+
summary=f"Ignoring `py_limited_api={self.py_limited_api!r}`.",
286+
details="`Py_LIMITED_API` is currently incompatible with "
287+
f"`Py_GIL_DISABLED` ({sys.abiflags=!r}).",
288+
see_url="https://github.com/python/cpython/issues/111506",
289+
)
290+
self.py_limited_api = False
291+
282292
# Support legacy [wheel] section for setting universal
283293
wheel = self.distribution.get_option_dict("wheel")
284294
if "universal" in wheel:

0 commit comments

Comments
 (0)