From 289a7fa2c9d260d3b0f9681f23f419b866dbf673 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 29 Jul 2025 14:01:09 +0300 Subject: [PATCH 1/3] Check number of expected dists --- .github/workflows/wheels.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f1c851bc7c8..8c8eaf55311 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -39,6 +39,7 @@ concurrency: cancel-in-progress: true env: + EXPECTED_DISTS: 91 FORCE_COLOR: 1 jobs: @@ -287,3 +288,20 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: attestations: true + + count-dists: + needs: [build-native-wheels, windows, sdist] + runs-on: ubuntu-latest + name: Count dists + steps: + - uses: actions/download-artifact@v4 + with: + pattern: dist-* + path: dist + merge-multiple: true + - name: "What did we get?" + run: | + ls -alR + echo "Number of dists, should be $EXPECTED_DISTS:" + ls -1 dist | wc -l + files=$(ls dist 2>/dev/null | wc -l) && [ "$files" -eq $EXPECTED_DISTS ] || exit 1 From bd29f651ea7443b9d39f43b7ae5a915fa95d6987 Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Sat, 11 Oct 2025 21:49:19 +1100 Subject: [PATCH 2/3] Count dists before uploading scientific wheels or publishing to PyPI (#139) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Andrew Murray --- .github/workflows/wheels.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8c8eaf55311..06ba7cb871f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -251,9 +251,27 @@ jobs: name: dist-sdist path: dist/*.tar.gz + count-dists: + needs: [build-native-wheels, windows, sdist] + runs-on: ubuntu-latest + name: Count dists + steps: + - uses: actions/download-artifact@v5 + with: + pattern: dist-* + path: dist + merge-multiple: true + - name: "What did we get?" + run: | + ls -alR + echo "Number of dists, should be $EXPECTED_DISTS:" + files=$(ls dist 2>/dev/null | wc -l) + echo $files + [ "$files" -eq $EXPECTED_DISTS ] || exit 1 + scientific-python-nightly-wheels-publish: if: github.repository_owner == 'python-pillow' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') - needs: [build-native-wheels, windows] + needs: count-dists runs-on: ubuntu-latest name: Upload wheels to scientific-python-nightly-wheels steps: @@ -270,7 +288,7 @@ jobs: pypi-publish: if: github.repository_owner == 'python-pillow' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - needs: [build-native-wheels, windows, sdist] + needs: count-dists runs-on: ubuntu-latest name: Upload release to PyPI environment: From 280f35de0ec0815f547f7a354c0055badc8ba897 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sat, 11 Oct 2025 13:51:37 +0300 Subject: [PATCH 3/3] Remove duplicate counts-dist --- .github/workflows/wheels.yml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 06ba7cb871f..9de8a440fc4 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -306,20 +306,3 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: attestations: true - - count-dists: - needs: [build-native-wheels, windows, sdist] - runs-on: ubuntu-latest - name: Count dists - steps: - - uses: actions/download-artifact@v4 - with: - pattern: dist-* - path: dist - merge-multiple: true - - name: "What did we get?" - run: | - ls -alR - echo "Number of dists, should be $EXPECTED_DISTS:" - ls -1 dist | wc -l - files=$(ls dist 2>/dev/null | wc -l) && [ "$files" -eq $EXPECTED_DISTS ] || exit 1