Skip to content

Commit 34a753a

Browse files
committed
Raise a clean error when py_limited_api is not supported
1 parent f64a665 commit 34a753a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

setuptools/command/bdist_wheel.py

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

2828
from .. import Command, __version__
29-
from ..warnings import SetuptoolsWarning
3029
from .egg_info import egg_info as egg_info_cls
3130

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

299298
if sysconfig.get_config_var("Py_GIL_DISABLED"):
300-
SetuptoolsWarning.emit(
301-
summary=f"Ignoring `py_limited_api={self.py_limited_api!r}`.",
302-
details="`Py_LIMITED_API` is currently incompatible with "
303-
f"`Py_GIL_DISABLED` ({sys.abiflags=!r}).",
304-
see_url="https://github.com/python/cpython/issues/111506",
299+
raise ValueError(
300+
f"`py_limited_api={self.py_limited_api!r}` not supported. "
301+
"`Py_LIMITED_API` is currently incompatible with "
302+
f"`Py_GIL_DISABLED` ({sys.abiflags=!r}). "
303+
"See https://github.com/python/cpython/issues/111506."
305304
)
306-
self.py_limited_api = False
307305

308306
@property
309307
def wheel_dist_name(self) -> str:

0 commit comments

Comments
 (0)