From da0ab6cbf2763b912e8ededfa2f28af1bd40bc2a Mon Sep 17 00:00:00 2001 From: Vishal Pankaj Chandratreya <19171016+tfpf@users.noreply.github.com> Date: Sun, 1 Dec 2024 20:35:33 +0530 Subject: [PATCH] Build wheels for PyPy on macOS (#33) * Try older setuptools to build macOS PyPy wheels * Updated classifiers and added comment explaining setuptools version * Use cibuildwheel GHA instead of specifying command * Explicitly request PyPy wheels * cibuildwheel will disable them by default in the future --- .github/workflows/package.yml | 9 ++++----- pyproject.toml | 7 ++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index af280ec..251e817 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -10,12 +10,11 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - run: pipx install cibuildwheel==2.21.3 - - run: cibuildwheel --output-dir wheelhouse + - uses: pypa/cibuildwheel@v2.22.0 + with: + output-dir: wheelhouse env: - # The Apple linker does not recognise one of the flags passed to it - # while building for PyPy. Skip it. - CIBW_SKIP: pp*-macosx* + CIBW_BUILD: cp* pp* CIBW_TEST_COMMAND: python -m unittest discover -s {package}/tests -t {package} - uses: actions/upload-artifact@v4 with: diff --git a/pyproject.toml b/pyproject.toml index dc3ddc6..39ed48d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,8 @@ [build-system] -requires = ["setuptools>=61.0"] +# The Apple linker does not recognise `-Bsymbolic-functions`, one of the +# arguments passed to it on macOS when building wheels for PyPy. Using an older +# version of setuptools fixes this problem. +requires = ["setuptools==70.0.0"] build-backend = "setuptools.build_meta" [project] @@ -19,6 +22,8 @@ classifiers = [ "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12",