Skip to content

Commit 0833f0e

Browse files
authored
Fix ABI tag for CPython 3.13 on Windows (#578)
CPython 3.13a1 on Windows now provides the SOABI sysconfig variable. However, the SOABI (and extension suffixes) are different on Windows than on Linux and macOS, e.g. `cp310-win_amd64` vs. `cpython-313-darwin`.
1 parent 5960057 commit 0833f0e

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

docs/news.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Release Notes
22
=============
33

4+
**UNRELEASED**
5+
6+
- Fixed ABI tag generation for CPython 3.13a1 on Windows (PR by Sam Gross)
7+
48
**0.41.2 (2023-08-22)**
59

610
- Fixed platform tag detection for GraalPy and 32-bit python running on an aarch64

src/wheel/bdist_wheel.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,12 @@ def get_abi_tag():
117117
m = "m"
118118

119119
abi = f"{impl}{tags.interpreter_version()}{d}{m}{u}"
120-
elif soabi and impl == "cp":
120+
elif soabi and impl == "cp" and soabi.startswith("cpython"):
121+
# non-Windows
121122
abi = "cp" + soabi.split("-")[1]
123+
elif soabi and impl == "cp" and soabi.startswith("cp"):
124+
# Windows
125+
abi = soabi.split("-")[0]
122126
elif soabi and impl == "pp":
123127
# we want something like pypy36-pp73
124128
abi = "-".join(soabi.split("-")[:2])

tests/test_bdist_wheel.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,12 @@ def test_unix_epoch_timestamps(dummy_dist, monkeypatch, tmp_path):
287287
)
288288

289289

290+
def test_get_abi_tag_windows(monkeypatch):
291+
monkeypatch.setattr(tags, "interpreter_name", lambda: "cp")
292+
monkeypatch.setattr(sysconfig, "get_config_var", lambda x: "cp313-win_amd64")
293+
assert get_abi_tag() == "cp313"
294+
295+
290296
def test_get_abi_tag_pypy_old(monkeypatch):
291297
monkeypatch.setattr(tags, "interpreter_name", lambda: "pp")
292298
monkeypatch.setattr(sysconfig, "get_config_var", lambda x: "pypy36-pp73")

0 commit comments

Comments
 (0)