Skip to content

Commit ad24375

Browse files
committed
Ignore py_limited_api on Py_GIL_DISABLED
1 parent 1a44048 commit ad24375

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

setuptools/command/bdist_wheel.py

Lines changed: 11 additions & 7 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
@@ -358,15 +359,18 @@ def _get_tag_impure(self, plat_name: str) -> tuple[str, str, str]:
358359
impl_name = tags.interpreter_name()
359360
impl_ver = tags.interpreter_version()
360361
impl = impl_name + impl_ver
362+
363+
if "t" in sys.abiflags:
364+
SetuptoolsWarning.emit(
365+
f"Ignoring `py_limited_api={self.py_limited_api!r}`: "
366+
f"currently incompatible with `Py_GIL_DISABLED` ({sys.abiflags=!r}).",
367+
see_url="https://github.com/python/cpython/issues/111506",
368+
)
369+
self.py_limited_api = None
370+
361371
# We don't work on CPython 3.1, 3.0.
362372
if self.py_limited_api and impl.startswith("cp3"):
363-
if "t" in impl_ver:
364-
log.warn(
365-
f"Ignoring abi3 implied by py_limited_api={self.py_limited_api!r} - "
366-
f"incompatible with {impl!r} interpreter."
367-
)
368-
else:
369-
abi_tag = "abi3"
373+
abi_tag = "abi3"
370374
impl = self.py_limited_api
371375
else:
372376
abi_tag = str(get_abi_tag()).lower()

0 commit comments

Comments
 (0)