From f96fefc27f90e4928110c5e9e488bb31f08fc71e Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Mon, 24 Aug 2026 09:43:41 +0000 Subject: [PATCH 1/2] TST: fix conditional expression in the abi3t wheel tag test The assertion parsed as: assert (abi == 'abi3.abi3t') if IS_ABI3T else 'abi3' which will never fail for GIL-enabled builds. --- tests/test_wheel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_wheel.py b/tests/test_wheel.py index 2fdf7a5a0..3fb3b4295 100644 --- a/tests/test_wheel.py +++ b/tests/test_wheel.py @@ -411,5 +411,5 @@ def test_limited_api_free_threaded(wheel_limited_api_free_threaded): artifact = wheel.wheelfile.WheelFile(wheel_limited_api_free_threaded) name = artifact.parsed_filename assert name.group('pyver') == INTERPRETER - assert name.group('abi') == 'abi3.abi3t' if FREE_THREADED_BUILD else 'abi3' + assert name.group('abi') == ('abi3.abi3t' if FREE_THREADED_BUILD else 'abi3') assert name.group('plat') == PLATFORM From d998683f6c3c8acd492c06598ef2f78479b0d28c Mon Sep 17 00:00:00 2001 From: Ralf Gommers Date: Mon, 24 Aug 2026 09:43:41 +0000 Subject: [PATCH 2/2] TST: add test for the stable ABI filename suffix multiarch tuple Python 3.15 and later append the multiarch tuple to the stable ABI filename suffix. The multiarch tuple is not part of the ABI tag and must be ignored: when cross compiling it is the one of the host platform and differs from the one of the build interpreter. This test fails without the regular expression fix in commit 865aa61. --- tests/test_tags.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_tags.py b/tests/test_tags.py index c48045b9e..0fb3fcfd4 100644 --- a/tests/test_tags.py +++ b/tests/test_tags.py @@ -54,6 +54,7 @@ def get_abi3_suffix(): SUFFIX = sysconfig.get_config_var('EXT_SUFFIX') ABI3SUFFIX = get_abi3_suffix() +STABLE_ABI_KIND = 'abi3t' if FREE_THREADED_BUILD and sys.version_info >= (3, 15) else 'abi3' def test_wheel_tag(): @@ -162,3 +163,16 @@ def test_tag_mixed_abi(): }, pure=False, limited_api=True) with pytest.raises(mesonpy.BuildError, match='The package declares compatibility with Python limited API but '): assert str(builder.tag) == f'{INTERPRETER}-abi3-{PLATFORM}' + + +@pytest.mark.skipif(not ABI3SUFFIX, reason='interpreter does not support the stable ABI') +def test_tag_stable_abi_multiarch(): + # Python 3.15 and later append the multiarch tuple to the stable ABI + # filename suffix. Verify that it is ignored rather than causing the + # module to be rejected: when cross compiling it differs from the one + # of the build interpreter. + builder = wheel_builder_test_factory({ + 'platlib': [f'extension.{STABLE_ABI_KIND}-aarch64-linux-gnu.so'], + }, pure=False, limited_api=True) + abi = 'abi3.abi3t' if STABLE_ABI_KIND == 'abi3t' else 'abi3' + assert str(builder.tag) == f'{INTERPRETER}-{abi}-{PLATFORM}'