Skip to content

Commit

Permalink
✨ Apple Silicon (arm64) support, fixes #36
Browse files Browse the repository at this point in the history
Note that we (cross) compile for both arm64 and the universal2.
This may feel redundant, it can still be interesting to have both.
While universal2 is more convenient arm64 is lighter.

Also drop Python 3.7 (end-of-life 2023-06-27).
Add Python 3.12 and pypy-3.10 support.

Bump CI actions versions as well.
  • Loading branch information
AndreMiras committed Oct 15, 2023
1 parent 09ec066 commit 760870f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,26 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]
os: [ubuntu-22.04, windows-2022, macOS-11]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all
# Used to host cibuildwheel
- name: Build wheels
uses: pypa/cibuildwheel@v2.12.0
uses: pypa/cibuildwheel@v2.16.2
env:
# configure cibuildwheel to build native archs ('auto'), and some emulated ones
CIBW_ARCHS_LINUX: auto aarch64 ppc64le
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_TEST_REQUIRES: .[test]
CIBW_TEST_COMMAND: pytest {project}
# arm64 cannot be tested on a x86_64 CI runner
CIBW_TEST_SKIP: *-macosx_arm64
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
Expand All @@ -31,7 +36,7 @@ jobs:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
Expand All @@ -44,13 +49,13 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.5.0
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
user: __token__
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ name: Tests

on: [push]

env:
PYTHON_VERSIONS: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8", "pypy-3.9", "pypy-3.10"]

jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", pypy-3.7, pypy-3.8, pypy-3.9]
python: ${{fromJson(env.PYTHON_VERSIONS)}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
Expand All @@ -21,10 +24,10 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11", pypy-3.7, pypy-3.8, pypy-3.9]
python: ${{fromJson(env.PYTHON_VERSIONS)}}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
'Operating System :: POSIX',
'Programming Language :: C',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries :: Python Modules',
],
Expand Down

0 comments on commit 760870f

Please sign in to comment.