8000 ENH: do not check extension module file name against expected suffix · mesonbuild/meson-python@3678a77 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3678a77

Browse files
committed
ENH: do not check extension module file name against expected suffix
Checking that the extensions modules filenames end with a suffix accepted by the current Python interpreter assumes that the wheel being assembled is for the same Python platform. This is not true when cross-compiling. The check protects against a very unlikely occurrence and makes life harder for tools that allow cross-compiling Python wheels. Remove it. See #321.
1 parent a369230 commit 3678a77

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

mesonpy/__init__.py

Lines changed: 2 additions & 6 deletions
9B88
Original file line numberDiff line numberDiff line change
@@ -334,13 +334,9 @@ def _stable_abi(self) -> Optional[str]:
334334
match = re.match(r'^[^.]+(.*)$', path.name)
335335
assert match is not None
336336
suffix = match.group(1)
337-
if suffix not in _EXTENSION_SUFFIXES:
338-
raise ValueError(
339-
f'Extension module {str(path)!r} not compatible with Python interpreter. '
340-
f'Filename suffix {suffix!r} not in {set(_EXTENSION_SUFFIXES)}.')
341337
match = _EXTENSION_SUFFIX_REGEX.match(suffix)
342-
assert match is not None
343-
abis.append(match.group('abi'))
338+
if match:
339+
abis.append(match.group('abi'))
344340

345341
stable = [x for x in abis if x and re.match(r'abi\d+', x)]
346342
if len(stable) > 0 and len(stable) == len(abis) and all(x == stable[0] for x in stable[1:]):

0 commit comments

Comments
 (0)
0