Skip to content

Commit

Permalink
ENH: do not check extension module file name against expected suffix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dnicolodi committed Mar 1, 2023
1 parent a369230 commit 3678a77
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mesonpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,9 @@ def _stable_abi(self) -> Optional[str]:
match = re.match(r'^[^.]+(.*)$', path.name)
assert match is not None
suffix = match.group(1)
if suffix not in _EXTENSION_SUFFIXES:
raise ValueError(
f'Extension module {str(path)!r} not compatible with Python interpreter. '
f'Filename suffix {suffix!r} not in {set(_EXTENSION_SUFFIXES)}.')
match = _EXTENSION_SUFFIX_REGEX.match(suffix)
assert match is not None
abis.append(match.group('abi'))
if match:
abis.append(match.group('abi'))

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

0 comments on commit 3678a77

Please sign in to comment.