Skip to content

Commit 40d29d2

Browse files
committed
Prevent abi3 from being used with no-GIL interpreter
1 parent 2299319 commit 40d29d2

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
@@ -27,6 +27,7 @@
2727
from ..extern.packaging import tags
2828
from ..extern.packaging import version as _packaging_version
2929
from ..extern.wheel.wheelfile import WheelFile
30+
from ..warnings import SetuptoolsWarning
3031

3132
if TYPE_CHECKING:
3233
import types
@@ -280,6 +281,15 @@ def finalize_options(self):
280281
):
281282
raise ValueError(f"py-limited-api must match '{PY_LIMITED_API_PATTERN}'")
282283

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

0 commit comments

Comments
 (0)