Skip to content

Commit

Permalink
Raise a clean error when py_limited_api is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Aug 12, 2024
1 parent f64a665 commit 34a753a
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions setuptools/command/bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from wheel.wheelfile import WheelFile

from .. import Command, __version__
from ..warnings import SetuptoolsWarning
from .egg_info import egg_info as egg_info_cls

from distutils import log
Expand Down Expand Up @@ -297,13 +296,12 @@ def _validate_py_limited_api(self) -> None:
raise ValueError(f"py-limited-api must match '{PY_LIMITED_API_PATTERN}'")

if sysconfig.get_config_var("Py_GIL_DISABLED"):
SetuptoolsWarning.emit(
summary=f"Ignoring `py_limited_api={self.py_limited_api!r}`.",
details="`Py_LIMITED_API` is currently incompatible with "
f"`Py_GIL_DISABLED` ({sys.abiflags=!r}).",
see_url="https://github.com/python/cpython/issues/111506",
raise ValueError(
f"`py_limited_api={self.py_limited_api!r}` not supported. "
"`Py_LIMITED_API` is currently incompatible with "
f"`Py_GIL_DISABLED` ({sys.abiflags=!r}). "
"See https://github.com/python/cpython/issues/111506."
)
self.py_limited_api = False

@property
def wheel_dist_name(self) -> str:
Expand Down

0 comments on commit 34a753a

Please sign in to comment.