From 379dd5653baa9a252bd46bf05982a7de61a82c2e Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Fri, 18 Oct 2024 17:19:23 +0200 Subject: [PATCH] update ci workflows to build wheels for python 3.13 --- .github/workflows/wheels.yml | 34 ++++++++++++++++------------------ pyproject.toml | 4 +++- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 5a2b749..131ef8f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -15,7 +15,9 @@ jobs: strategy: fail-fast: false matrix: - os: [ "ubuntu-latest", "windows-latest", "macos-latest" ] + # macos-13 runners are still x86_64, macos-14 (latest) are arm64; we want to build + # the x86_64 wheel on/for x86_64 macs + os: [ "ubuntu-latest", "windows-latest", "macos-13" ] env: CIBW_ARCHS: auto64 CIBW_ARCHS_MACOS: "x86_64 universal2" @@ -25,18 +27,18 @@ jobs: # * PyPy on Windows. CIBW_SKIP: cp36-* cp37-* pp*-win_amd64 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.x" - name: Install cibuildwheel run: python -m pip install cibuildwheel - name: Build wheels run: python -m cibuildwheel --output-dir dist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: wheels-${{ matrix.os }} path: dist/*.whl @@ -46,7 +48,7 @@ jobs: 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] env: # Skip building aarch64 wheels for musllinux until someone ask... @@ -54,7 +56,7 @@ jobs: CIBW_BUILD: cp${{ matrix.python }}-* CIBW_ARCHS: ${{ matrix.arch }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive - uses: docker/setup-qemu-action@v1.2.0 @@ -64,7 +66,7 @@ jobs: run: pip install cibuildwheel - name: Build and Test Wheels run: python -m cibuildwheel --output-dir dist - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: wheels-${{ matrix.python }}-linux-${{ matrix.arch }} path: dist/*.whl @@ -76,11 +78,11 @@ jobs: needs: [build_wheels, build_aarch64_wheels] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: recursive - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: "3.x" - name: Install dependencies @@ -88,8 +90,9 @@ jobs: python -m pip install --upgrade pip pip install --upgrade setuptools wheel twine cython - name: Download artifacts from build jobs - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: + merge-multiple: true path: dist - name: Extract release notes from annotated tag message id: release_notes @@ -115,13 +118,8 @@ jobs: fi - 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 }} @@ -136,4 +134,4 @@ jobs: echo "DEBUG: This is a final release" fi python setup.py sdist - twine upload dist/wheels-*/*.whl dist/*.tar.gz + twine upload dist/*.whl dist/*.tar.gz diff --git a/pyproject.toml b/pyproject.toml index 59af397..3392f36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", "cython >= 0.28.5", ]