Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions abi3audit/_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@

logger = logging.getLogger(__name__)

# A handpicked exclusion list of symbols that are not strictly in the limited API
# or stable ABI, but in practice always appear in ABI3-compatible code.
# Since they are not listed in CPython's `stable_abi.toml`, we maintain them here separately.
# For more information, see https://github.com/pypa/abi3audit/issues/85
# and https://github.com/wjakob/nanobind/discussions/500 .
_ALLOWED_SYMBOLS: set[str] = {
"Py_XDECREF", # not stable ABI, but defined as static inline in limited API
}


class AuditError(Exception):
pass
Expand Down Expand Up @@ -134,7 +125,7 @@ def audit(so: SharedObject, assume_minimum_abi3: PyVersion = PyVersion(3, 2)) ->
continue
# Local symbols are fine, since they are inlined functions
# from the CPython limited API.
if sym.name not in _ALLOWED_SYMBOLS and sym.visibility != "local":
if sym.visibility != "local":
non_abi3_symbols.add(sym)
except Exception as exc:
raise AuditError(f"failed to collect symbols in shared object: {exc}") from exc
Expand Down
11 changes: 1 addition & 10 deletions test/test_audit_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,14 @@ def __iter__(self) -> Iterator[Symbol]:
),
],
),
SharedObject(
baseline=PyVersion(3, 10),
computed=PyVersion(3, 10),
symbols=[
Symbol("PyType_GetModule", "global"),
# This test is just to assert the existing behaviour. Py_XDECREF is never a global
# symbol and will always be local.
Symbol("Py_XDECREF", "global"),
],
),
SharedObject(
baseline=PyVersion(3, 9),
computed=PyVersion(3, 14),
symbols=[
Symbol("PyType_GetModule", "global"),
Symbol("Py_TYPE", "global"),
Symbol("Py_REFCNT", "local"),
Symbol("Py_XDECREF", "local"),
],
future_abi3_objects=[
Function(
Expand Down