Skip to content

Commit c3aafba

Browse files
FrancescAltedclaude
andcommitted
Assert the abi3 module by absence of a version tag, not a ".abi3." infix
The Windows legs of test_abi3_matrix failed on all five Python versions while the wheel builds and the Linux/macOS legs passed. The wheel was fine: the install step succeeded and only the assertion step failed. ".abi3." is a POSIX naming convention. On Windows a limited-API extension is just `blosc2_ext.pyd`, against `blosc2_ext.cp314-win_amd64.pyd` for a version-specific build -- there is no abi3 infix to look for. Check the portable invariant instead: importlib's EXTENSION_SUFFIXES[0] is the version-tagged suffix on every platform, so an abi3 module is exactly the one whose filename does not end with it. Verified locally against both a normal and an abi3 build. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 872ae39 commit c3aafba

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/cibuildwheels.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,23 @@ jobs:
256256
python -m pip install --upgrade pip
257257
python -m pip install --find-links ./wheelhouse "blosc2==$(basename "$WHL" | cut -d- -f2)"
258258
259+
# Check that the module is not version-tagged, rather than looking for a
260+
# literal ".abi3." -- that infix is a POSIX convention. On Windows a
261+
# limited-API module is just `blosc2_ext.pyd`, versus
262+
# `blosc2_ext.cp314-win_amd64.pyd` for a version-specific build.
263+
# EXTENSION_SUFFIXES[0] is the version-tagged suffix on every platform,
264+
# so "does not end with it" is the portable way to say "this is abi3".
259265
- name: Confirm the abi3 module was the one loaded
260266
shell: bash
261267
run: |
262268
python -c "
269+
import importlib.machinery as machinery, os
263270
import blosc2, blosc2.blosc2_ext as ext
264-
assert '.abi3.' in ext.__file__, f'not an abi3 module: {ext.__file__}'
265-
print('OK:', ext.__file__)
271+
name = os.path.basename(ext.__file__)
272+
tagged = machinery.EXTENSION_SUFFIXES[0]
273+
print('module:', name, '| version-tagged suffix:', tagged)
274+
assert not name.endswith(tagged), f'version-specific module: {name}'
275+
print('OK: loaded a version-independent (abi3) module')
266276
blosc2.print_versions()
267277
"
268278

0 commit comments

Comments
 (0)