From 19fd195387fb5baa9ce591165780230327279dbe Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Sun, 15 Dec 2024 21:25:45 +0000 Subject: [PATCH 1/2] Fix artefact upload names --- .github/workflows/upload_to_pypi.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/upload_to_pypi.yml b/.github/workflows/upload_to_pypi.yml index e6ee04f..d3f9e22 100644 --- a/.github/workflows/upload_to_pypi.yml +++ b/.github/workflows/upload_to_pypi.yml @@ -2,7 +2,10 @@ name: Build and upload to PyPI on: release: - types: [published] + types: [published, edited] + push: +# branches: +# - main jobs: build_wheels: @@ -25,10 +28,11 @@ jobs: # available yet which can cause the build to fail. Keep going, and upload # the wheels for all of the previous versions when that happens. continue-on-error: true - uses: pypa/cibuildwheel@v2.20.0 + uses: pypa/cibuildwheel@v2.22.0 - uses: actions/upload-artifact@v4 with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} path: ./wheelhouse/*.whl build_sdist: @@ -50,17 +54,22 @@ jobs: - uses: actions/upload-artifact@v4 with: + name: cibw-sdist path: dist/*.tar.gz upload_pypi: name: Upload to PyPI needs: [build_wheels, build_sdist] runs-on: ubuntu-latest + permissions: + id-token: write + if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/download-artifact@v4 with: - name: artifact - path: dist + pattern: cibw-* + path: dist + merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 with: From 8e14c03d3d4175168579893033f97a94a30d92ef Mon Sep 17 00:00:00 2001 From: Luke Shingles Date: Sun, 15 Dec 2024 21:32:08 +0000 Subject: [PATCH 2/2] Set build requirement numpy<2 for python < 3.9 --- .github/workflows/upload_to_pypi.yml | 3 --- pyproject.toml | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/upload_to_pypi.yml b/.github/workflows/upload_to_pypi.yml index d3f9e22..480b1e7 100644 --- a/.github/workflows/upload_to_pypi.yml +++ b/.github/workflows/upload_to_pypi.yml @@ -72,6 +72,3 @@ jobs: merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 4d11fc5..474f977 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "wheel", "setuptools", "Cython>=0.29.2", - "oldest-supported-numpy; python_version<'3.9'", + "numpy<2; python_version<'3.9'", "numpy>=2; python_version>='3.9'", ] build-backend = 'setuptools.build_meta'