summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Darbois <mayeut@users.noreply.github.com>2023-04-24 12:22:58 +0200
committerGitHub <noreply@github.com>2023-04-24 12:22:58 +0200
commit7282a9202bf101b13991e2163c8cabdae3ba62ba (patch)
treec1355464f3579257dd8845e4aa19f4edc1b7687a
parent12fe73d2ed9c10ee5fa9b2e9fe00a2a27fe77e22 (diff)
downloadpsutil-7282a9202bf101b13991e2163c8cabdae3ba62ba.tar.gz
Run `abi3audit` on produced abi3 wheels (#2247)
Signed-off-by: mayeut <mayeut@users.noreply.github.com>
-rw-r--r--.github/workflows/build.yml1
-rwxr-xr-xsetup.py9
2 files changed, 9 insertions, 1 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d735a0ce..6c3ab484 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -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
diff --git a/setup.py b/setup.py
index b38c6a6a..2b8b2abb 100755
--- a/setup.py
+++ b/setup.py
@@ -61,7 +61,9 @@ from _compat import which # NOQA
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:
@@ -112,9 +114,14 @@ macros.append(('PSUTIL_VERSION', int(VERSION.replace('.', ''))))
# 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 = {}