Skip to content

Commit

Permalink
Ignore py_limited_api on Py_GIL_DISABLED
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Jun 19, 2024
1 parent 1a44048 commit ad24375
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions setuptools/command/bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from ..extern.packaging import tags
from ..extern.packaging import version as _packaging_version
from ..extern.wheel.wheelfile import WheelFile
from ..warnings import SetuptoolsWarning

if TYPE_CHECKING:
import types
Expand Down Expand Up @@ -358,15 +359,18 @@ def _get_tag_impure(self, plat_name: str) -> tuple[str, str, str]:
impl_name = tags.interpreter_name()
impl_ver = tags.interpreter_version()
impl = impl_name + impl_ver

if "t" in sys.abiflags:
SetuptoolsWarning.emit(
f"Ignoring `py_limited_api={self.py_limited_api!r}`: "
f"currently incompatible with `Py_GIL_DISABLED` ({sys.abiflags=!r}).",
see_url="https://github.com/python/cpython/issues/111506",
)
self.py_limited_api = None

# We don't work on CPython 3.1, 3.0.
if self.py_limited_api and impl.startswith("cp3"):
if "t" in impl_ver:
log.warn(
f"Ignoring abi3 implied by py_limited_api={self.py_limited_api!r} - "
f"incompatible with {impl!r} interpreter."
)
else:
abi_tag = "abi3"
abi_tag = "abi3"
impl = self.py_limited_api
else:
abi_tag = str(get_abi_tag()).lower()
Expand Down

0 comments on commit ad24375

Please sign in to comment.