Skip to content

Commit

Permalink
Merge pull request #3433 from bdarnell/abi3audit
Browse files Browse the repository at this point in the history
setup: Simplify build of abi3 wheels and add tests
  • Loading branch information
bdarnell authored Oct 24, 2024
2 parents f19005a + b690f4c commit 385fd88
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022, macos-12]
os: [ubuntu-22.04, windows-2022, macos-15]

steps:
- uses: actions/checkout@v4
Expand All @@ -64,6 +64,11 @@ jobs:
- name: Build wheels
uses: pypa/[email protected]

- name: Audit ABI3 compliance
# This may be moved into cibuildwheel itself in the future. See
# https://github.com/pypa/cibuildwheel/issues/1342
run: "pip install abi3audit && abi3audit --verbose --summary ./wheelhouse/*.whl"

- uses: actions/upload-artifact@v4
with:
name: artifacts-${{ matrix.os }}
Expand Down
17 changes: 1 addition & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
import platform
import setuptools

try:
import wheel.bdist_wheel
except ImportError:
wheel = None


kwargs = {}

Expand Down Expand Up @@ -56,17 +51,7 @@
)
]

if wheel is not None:
# From https://github.com/joerick/python-abi3-package-sample/blob/main/setup.py
class bdist_wheel_abi3(wheel.bdist_wheel.bdist_wheel):
def get_tag(self):
python, abi, plat = super().get_tag()

if python.startswith("cp"):
return "cp39", "abi3", plat
return python, abi, plat

kwargs["cmdclass"] = {"bdist_wheel": bdist_wheel_abi3}
kwargs["options"] = {"bdist_wheel": {"py_limited_api": "cp39"}}


setuptools.setup(
Expand Down

0 comments on commit 385fd88

Please sign in to comment.