@@ -406,22 +406,23 @@ def entrypoints_txt(self) -> bytes:
406
406
407
407
@cached_property
408
408
def _stable_abi (self ) -> Optional [str ]:
409
- if self ._limited_api :
410
- # PyPy does not use a special extension module filename
411
- # suffix for modules targeting the stable API.
412
- if '__pypy__' not in sys .builtin_module_names :
413
- # Verify stable ABI compatibility: examine files installed
414
- # in {platlib} that look like extension modules, and raise
415
- # an exception if any of them has a Python version
416
- # specific extension filename suffix ABI tag.
417
- for path , _ in self ._manifest ['platlib' ]:
418
- match = _EXTENSION_SUFFIX_REGEX .match (path .name )
419
- if match :
420
- abi = match .group ('abi' )
421
- if abi is not None and abi != 'abi3' :
422
- raise BuildError (
423
- f'The package declares compatibility with Python limited API but extension '
424
- f'module { os .fspath (path )!r} is tagged for a specific Python version.' )
409
+ # PyPy supports the limited API but does not provide a stable
410
+ # ABI, therefore extension modules using the limited API do
411
+ # not use the stable ABI filename suffix and wheels should not
412
+ # be tagged with the abi3 tag.
413
+ if self ._limited_api and '__pypy__' not in sys .builtin_module_names :
414
+ # Verify stable ABI compatibility: examine files installed
415
+ # in {platlib} that look like extension modules, and raise
416
+ # an exception if any of them has a Python version
417
+ # specific extension filename suffix ABI tag.
418
+ for path , _ in self ._manifest ['platlib' ]:
419
+ match = _EXTENSION_SUFFIX_REGEX .match (path .name )
420
+ if match :
421
+ abi = match .group ('abi' )
422
+ if abi is not None and abi != 'abi3' :
423
+ raise BuildError (
424
+ f'The package declares compatibility with Python limited API but extension '
425
+ f'module { os .fspath (path )!r} is tagged for a specific Python version.' )
425
426
return 'abi3'
426
427
return None
427
428
0 commit comments