From 875335ac2f1853a125ccab7d744db5a95968f095 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Mon, 21 Oct 2024 10:14:19 +0200 Subject: [PATCH] update ci workflows to build wheels for python 3.13 --- .github/workflows/ci.yml | 43 ++++++++++++++++++++-------------------- pyproject.toml | 4 +++- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db92a4f..44217e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} @@ -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*"] @@ -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 @@ -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 @@ -98,9 +100,10 @@ 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 }} @@ -108,14 +111,14 @@ 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] 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 @@ -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 @@ -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 @@ -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 }} diff --git a/pyproject.toml b/pyproject.toml index 8b63d75..b24e0d7 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", "setuptools_scm", "setuptools_git_ls_files",