@@ -382,18 +382,21 @@ def entrypoints_txt(self) -> bytes:
382
382
@cached_property
383
383
def _stable_abi (self ) -> Optional [str ]:
384
384
if self ._limited_api :
385
- # Verify stabe ABI compatibility: examine files installed
386
- # in {platlib} that look like extension modules, and raise
387
- # an exception if any of them has a Python version
388
- # specific extension filename suffix ABI tag.
389
- for path , _ in self ._manifest ['platlib' ]:
390
- match = _EXTENSION_SUFFIX_REGEX .match (path .name )
391
- if match :
392
- abi = match .group ('abi' )
393
- if abi is not None and abi != 'abi3' :
394
- raise BuildError (
395
- f'The package declares compatibility with Python limited API but extension '
396
- f'module { os .fspath (path )!r} is tagged for a specific Python version.' )
385
+ # PyPy does not use a special extension module filename
386
+ # suffix for modules targeting the stable API.
387
+ if '__pypy__' not in sys .builtin_module_names :
388
+ # Verify stable ABI compatibility: examine files installed
389
+ # in {platlib} that look like extension modules, and raise
390
+ # an exception if any of them has a Python version
391
+ # specific extension filename suffix ABI tag.
392
+ for path , _ in self ._manifest ['platlib' ]:
393
+ match = _EXTENSION_SUFFIX_REGEX .match (path .name )
394
+ if match :
395
+ abi = match .group ('abi' )
396
+ if abi is not None and abi != 'abi3' :
397
+ raise BuildError (
398
+ f'The package declares compatibility with Python limited API but extension '
399
+ f'module { os .fspath (path )!r} is tagged for a specific Python version.' )
397
400
return 'abi3'
398
401
return None
399
402
0 commit comments