Skip to content

Commit

Permalink
Run abi3audit on produced abi3 wheels (#2247)
Browse files Browse the repository at this point in the history
Signed-off-by: mayeut <mayeut@users.noreply.github.com>
  • Loading branch information
mayeut authored Apr 24, 2023
1 parent 12fe73d commit 7282a92
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,4 @@ jobs:
- run: |
python scripts/internal/print_hashes.py wheelhouse/
pipx run twine check --strict wheelhouse/*
pipx run abi3audit --verbose --strict wheelhouse/*-abi3-*.whl
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@

PYPY = '__pypy__' in sys.builtin_module_names
PY36_PLUS = sys.version_info[:2] >= (3, 6)
PY37_PLUS = sys.version_info[:2] >= (3, 7)
CP36_PLUS = PY36_PLUS and sys.implementation.name == "cpython"
CP37_PLUS = PY37_PLUS and sys.implementation.name == "cpython"

macros = []
if POSIX:
Expand Down Expand Up @@ -112,9 +114,14 @@ def get_version():

# Py_LIMITED_API lets us create a single wheel which works with multiple
# python versions, including unreleased ones.
if bdist_wheel and CP36_PLUS and (MACOS or LINUX or WINDOWS):
if bdist_wheel and CP36_PLUS and (MACOS or LINUX):
py_limited_api = {"py_limited_api": True}
macros.append(('Py_LIMITED_API', '0x03060000'))
elif bdist_wheel and CP37_PLUS and WINDOWS:
# PyErr_SetFromWindowsErr / PyErr_SetFromWindowsErrWithFilename are
# part of the stable API/ABI starting with CPython 3.7
py_limited_api = {"py_limited_api": True}
macros.append(('Py_LIMITED_API', '0x03070000'))
else:
py_limited_api = {}

Expand Down

0 comments on commit 7282a92

Please sign in to comment.