Skip to content

Commit 5024a54

Browse files
committed
fix: better abiflags impl, 3.14 ready
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 96a94e2 commit 5024a54

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/scikit_build_core/builder/sysconfig.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,18 @@ def get_abi_flags() -> str:
193193
Return the ABI flags for the current Python interpreter. Derived from
194194
``packaging.tags.sys_tags()`` since that works on Windows.
195195
"""
196-
197-
most_compatible = next(iter(packaging.tags.sys_tags()))
198-
full_abi = most_compatible.abi
199-
vers = packaging.tags.interpreter_version()
200-
abi_flags = full_abi[full_abi.find(vers) + len(vers) :]
201-
return "".join(sorted(abi_flags))
196+
abi_flags: str | None = sysconfig.get_config_var("ABIFLAGS")
197+
if abi_flags:
198+
return abi_flags
199+
200+
if sys.implementation.name == "cpython" and sys.platform.startswith("win32"):
201+
most_compatible = next(iter(packaging.tags.sys_tags()))
202+
full_abi = most_compatible.abi
203+
vers = packaging.tags.interpreter_version()
204+
abi_flags = full_abi[full_abi.find(vers) + len(vers) :]
205+
return "".join(sorted(abi_flags))
206+
207+
return ""
202208

203209

204210
def info_print(

0 commit comments

Comments
 (0)