Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wheel ABI tag for debug Python 3.13 on Windows #4676

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/4674.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the ABI tag when building a wheel using the debug build of Python 3.13 on Windows. Previously, the ABI tag was missing the ``"d"`` flag.
3 changes: 3 additions & 0 deletions setuptools/command/bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ def get_abi_tag() -> str | None:
elif soabi and impl == "cp" and soabi.startswith("cp"):
# Windows
abi = soabi.split("-")[0]
if hasattr(sys, "gettotalrefcount"):
# using debug build; append "d" flag
abi += "d"
elif soabi and impl == "pp":
# we want something like pypy36-pp73
abi = "-".join(soabi.split("-")[:2])
Expand Down
6 changes: 6 additions & 0 deletions setuptools/tests/test_bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,12 @@ def test_get_abi_tag_windows(monkeypatch):
monkeypatch.setattr(tags, "interpreter_name", lambda: "cp")
monkeypatch.setattr(sysconfig, "get_config_var", lambda x: "cp313-win_amd64")
assert get_abi_tag() == "cp313"
monkeypatch.setattr(sys, "gettotalrefcount", lambda: 1, False)
assert get_abi_tag() == "cp313d"
monkeypatch.setattr(sysconfig, "get_config_var", lambda x: "cp313t-win_amd64")
assert get_abi_tag() == "cp313td"
monkeypatch.delattr(sys, "gettotalrefcount")
assert get_abi_tag() == "cp313t"


def test_get_abi_tag_pypy_old(monkeypatch):
Expand Down
Loading