From 374c64fba6f64716ea797d31a511f60fb5557cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 15:15:55 +0200 Subject: [PATCH 1/9] Rewrote the github actions --- .github/workflows/build.yml | 77 +++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..776f16b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,77 @@ +name: Build and Deploy Package (New) + +on: + push: + branches: + release: + types: [created] + pull_request: + +jobs: + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: "recursive" + + - name: Build sdist + run: | + pip install -r requirements.txt + python setup.py sdist + + - uses: actions/upload-artifact@v3 + with: + path: dist/*.tar.gz + + build_wheels: + name: Build wheels on ${{ matrix.os }} CIBW_BUILD=${{ matrix.cibw_build }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + cibw_build: [cp38-*, cp39-*, cp310-*, cp311-*] + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + with: + submodules: "recursive" + + - name: Setup QEMU # Needed to build aarch64 wheels + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v2 + with: + platforms: all + + - name: Build wheels + uses: pypa/cibuildwheel@v2.12.3 + env: + CIBW_ARCHS_LINUX: "x86_64 i686 aarch64" + CIBW_ARCHS_MACOS: "x86_64 arm64" + CIBW_ARCHS_WINDOWS: "AMD64 x86" + CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_BEFORE_BUILD: pip install -r requirements.txt + CIBW_TEST_COMMAND: "pytest" + + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + + upload_pypi: + needs: [build_sdist, build_wheels] + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/') + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.8.8 + with: + user: __token__ + password: ${{ secrets.pypi_api_token }} From a35d8b19d8f316a7c3353b2c1950b76de1a0d9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 15:19:43 +0200 Subject: [PATCH 2/9] Fixed test location --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 776f16b..576aa25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: CIBW_ARCHS_WINDOWS: "AMD64 x86" CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_BEFORE_BUILD: pip install -r requirements.txt - CIBW_TEST_COMMAND: "pytest" + CIBW_TEST_COMMAND: "pytest {project}/test" - name: Upload Artifacts From 24a4d58cc920e3cb70ba73f8fdd890e723c6c1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 15:35:41 +0200 Subject: [PATCH 3/9] Fetch complete history --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 576aa25..ca10e27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: "recursive" + fetch-depth: 0 - name: Build sdist run: | @@ -54,7 +55,6 @@ jobs: CIBW_BEFORE_BUILD: pip install -r requirements.txt CIBW_TEST_COMMAND: "pytest {project}/test" - - name: Upload Artifacts uses: actions/upload-artifact@v3 with: From e8cac9648dac2ffd957ff0e4d753b3ee94914c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 15:46:34 +0200 Subject: [PATCH 4/9] Add pytest as test requires --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca10e27..f4a0b98 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: name: Build wheels on ${{ matrix.os }} CIBW_BUILD=${{ matrix.cibw_build }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] cibw_build: [cp38-*, cp39-*, cp310-*, cp311-*] @@ -53,6 +54,7 @@ jobs: CIBW_ARCHS_WINDOWS: "AMD64 x86" CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_BEFORE_BUILD: pip install -r requirements.txt + CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: "pytest {project}/test" - name: Upload Artifacts From 86e5d48e341cac1600a174dfd8891520e62811ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 15:59:26 +0200 Subject: [PATCH 5/9] Don't test on macos-arm and don't build musllinux on aarch64 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4a0b98..4274dc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,9 +53,11 @@ jobs: CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_ARCHS_WINDOWS: "AMD64 x86" CIBW_BUILD: ${{ matrix.cibw_build }} + CIBW_SKIP: "*-musllinux_aarch64" CIBW_BEFORE_BUILD: pip install -r requirements.txt CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: "pytest {project}/test" + CIBW_TEST_SKIP: "*-macosx_arm64" - name: Upload Artifacts uses: actions/upload-artifact@v3 From 8bdbbb249fda1da60f7e854b5b4dcf874e4b166e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 16:05:51 +0200 Subject: [PATCH 6/9] It's not required to install the requirements.txt --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4274dc5..62d559a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,7 +54,6 @@ jobs: CIBW_ARCHS_WINDOWS: "AMD64 x86" CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_SKIP: "*-musllinux_aarch64" - CIBW_BEFORE_BUILD: pip install -r requirements.txt CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: "pytest {project}/test" CIBW_TEST_SKIP: "*-macosx_arm64" From f6b0fce3c0113f30e64d7ab0638b6995fdba70ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 16:19:39 +0200 Subject: [PATCH 7/9] Final touches --- .github/workflows/build.yml | 8 ++++---- .github/workflows/run-tests.yml | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62d559a..eeab960 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build and Deploy Package (New) on: push: - branches: + branches: release: types: [created] pull_request: @@ -30,7 +30,6 @@ jobs: name: Build wheels on ${{ matrix.os }} CIBW_BUILD=${{ matrix.cibw_build }} runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] cibw_build: [cp38-*, cp39-*, cp310-*, cp311-*] @@ -39,6 +38,7 @@ jobs: uses: actions/checkout@v3 with: submodules: "recursive" + fetch-depth: 0 - name: Setup QEMU # Needed to build aarch64 wheels if: runner.os == 'Linux' @@ -53,10 +53,10 @@ jobs: CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_ARCHS_WINDOWS: "AMD64 x86" CIBW_BUILD: ${{ matrix.cibw_build }} - CIBW_SKIP: "*-musllinux_aarch64" + CIBW_SKIP: "*-musllinux_aarch64" # Don't build musllinux wheels for aarch64 CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: "pytest {project}/test" - CIBW_TEST_SKIP: "*-macosx_arm64" + CIBW_TEST_SKIP: "*-macosx_arm64" # Testing on Apple Silicon currently not supported. - name: Upload Artifacts uses: actions/upload-artifact@v3 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ed38bec..ac62ad1 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,21 +15,22 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11"] steps: - uses: actions/checkout@v3 with: submodules: 'recursive' + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install dependencies run: | python -m pip install --upgrade pip python -m pip install pytest - pip install -r requirements.txt pip install -e . - name: Test with pytest run: | From 1689385abc79d553051d6e50333deb04c5239a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 16:20:57 +0200 Subject: [PATCH 8/9] Only run for pull requests and on the master branch --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eeab960..dbd96be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,10 +2,11 @@ name: Build and Deploy Package (New) on: push: - branches: + branches: [ master ] release: - types: [created] + types: [ created ] pull_request: + branches: [ master ] jobs: build_sdist: From 11e98ce9a712e577ce82678a3b9e6a58e5204ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Rast?= Date: Mon, 7 Aug 2023 16:24:39 +0200 Subject: [PATCH 9/9] Don't build for pypy --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dbd96be..93bc45a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,7 +54,7 @@ jobs: CIBW_ARCHS_MACOS: "x86_64 arm64" CIBW_ARCHS_WINDOWS: "AMD64 x86" CIBW_BUILD: ${{ matrix.cibw_build }} - CIBW_SKIP: "*-musllinux_aarch64" # Don't build musllinux wheels for aarch64 + CIBW_SKIP: "pp* *-musllinux_aarch64" # Don't build musllinux wheels for aarch64 CIBW_TEST_REQUIRES: pytest CIBW_TEST_COMMAND: "pytest {project}/test" CIBW_TEST_SKIP: "*-macosx_arm64" # Testing on Apple Silicon currently not supported.