Skip to content

Commit

Permalink
update ci workflows to build wheels for python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
anthrotype committed Oct 21, 2024
1 parent 44c2f65 commit 875335a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
43 changes: 21 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ jobs:
name: Build Source Distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
# setuptools_scm won't work with shallow clone; fetch all history
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Build sdist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*.tar.gz
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
name: sdist

build_wheels:
name: ${{ matrix.type }} ${{ matrix.arch }} on ${{ matrix.os }}
Expand All @@ -43,7 +44,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
# macos-13 is needed to build x86_64 wheels for Mac (macos-14+ is arm64)
os: [macos-13, windows-latest]
arch: [auto64]
build: ["*"]
skip: ["cp36-* cp37-* pp*"]
Expand All @@ -66,7 +68,7 @@ jobs:
- os: ubuntu-latest
arch: auto64
type: manylinux2014
build: "pp39-manylinux* cp311-manylinux* cp312-manylinux*"
build: "pp39-manylinux* cp311-manylinux* cp312-manylinux* cp313-manylinux*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014

Expand All @@ -80,12 +82,12 @@ jobs:
build: "*"
skip: "cp36-* cp37-* pp*"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
Expand All @@ -98,24 +100,25 @@ jobs:
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.CIBW_MANYLINUX_X86_64_IMAGE }}
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: ${{ matrix.skip }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
name: wheels-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.type }}

build_arch_wheels:
name: py${{ matrix.python }} on ${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
matrix:
# aarch64 uses qemu so it's slow, build each py version in parallel jobs
python: [38, 39, 310, 311, 312]
python: [38, 39, 310, 311, 312, 313]
arch: [aarch64]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- uses: docker/setup-qemu-action@v1.2.0
- uses: docker/setup-qemu-action@v3.2.0
with:
platforms: all
- name: Install dependencies
Expand All @@ -125,9 +128,10 @@ jobs:
env:
CIBW_BUILD: cp${{ matrix.python }}-manylinux*
CIBW_ARCHS: ${{ matrix.arch }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: wheelhouse/*.whl
name: wheels-${{ matrix.python }}-linux-${{ matrix.arch }}

deploy:
name: Upload if tagged commit
Expand All @@ -137,11 +141,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
merge-multiple: true

- name: Extract release notes from annotated tag message
id: release_notes
Expand All @@ -168,18 +172,13 @@ jobs:
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body_path: "${{ runner.temp }}/release_notes.md"
draft: false
prerelease: ${{ env.IS_PRERELEASE }}

- uses: pypa/gh-action-pypi-publish@v1.4.2
- uses: pypa/gh-action-pypi-publish@v1.10.3
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[build-system]
requires = [
"setuptools",
# pin setuptools on pypy to workaround this bug: https://github.com/pypa/distutils/issues/283
"setuptools<72.2.0; platform_python_implementation == 'PyPy'",
"setuptools; platform_python_implementation != 'PyPy'",
"wheel",
"setuptools_scm",
"setuptools_git_ls_files",
Expand Down

0 comments on commit 875335a

Please sign in to comment.