diff --git a/pyproject.toml b/pyproject.toml index 2fe6669e66..4a671a2278 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,7 @@ doc = [ ssl = [] certs = [] core = [ - "packaging>=24.2", + "packaging @ git+https://github.com/ngoldbaum/packaging@abi3.abi3t", "more_itertools>=8.8", "jaraco.text>=3.7", "importlib_metadata>=6; python_version < '3.10'", diff --git a/setuptools/command/bdist_wheel.py b/setuptools/command/bdist_wheel.py index 3bdfa0b35a..97121a8796 100644 --- a/setuptools/command/bdist_wheel.py +++ b/setuptools/command/bdist_wheel.py @@ -281,11 +281,11 @@ def _validate_py_limited_api(self) -> None: if not re.match(PY_LIMITED_API_PATTERN, self.py_limited_api): raise ValueError(f"py-limited-api must match '{PY_LIMITED_API_PATTERN}'") - if sysconfig.get_config_var("Py_GIL_DISABLED"): + if sysconfig.get_config_var("Py_GIL_DISABLED") and sys.version_info < (3, 15): raise ValueError( f"`py_limited_api={self.py_limited_api!r}` not supported. " - "`Py_LIMITED_API` is currently incompatible with " - "`Py_GIL_DISABLED`. " + "`Py_LIMITED_API` is incompatible with `Py_GIL_DISABLED` " + "on Python 3.14 and older. " "See https://github.com/python/cpython/issues/111506." ) @@ -345,15 +345,19 @@ def get_tag(self) -> tuple[str, str, str]: # We don't work on CPython 3.1, 3.0. if self.py_limited_api and (impl_name + impl_ver).startswith("cp3"): impl = self.py_limited_api - abi_tag = "abi3" + if sysconfig.get_config_var("Py_GIL_DISABLED"): + abi_tag = "abi3.abi3t" + else: + abi_tag = "abi3" else: abi_tag = str(get_abi_tag()).lower() tag = (impl, abi_tag, plat_name) + tag_str = "-".join(tag) # issue gh-374: allow overriding plat_name supported_tags = [ (t.interpreter, t.abi, plat_name) for t in tags.sys_tags() ] - assert tag in supported_tags, ( + assert any((t.interpreter, t.abi, plat_name) in supported_tags for t in tags.parse_tag(tag_str)), ( f"would build wheel with unsupported tag {tag}" ) return tag