fix(ci): retry incomplete PyPI metadata after CLI uploads (#5370)

The [0.42.1 CLI publish
run](https://github.com/lancedb/lancedb/actions/runs/46743361906/job/143030097235)
uploaded all four distributions, then failed verification because the
first PyPI metadata response listed only some of the files. The workflow
fetched that response once and stopped at the first missing filename.
This change gives PyPI time to list every expected file while still
rejecting a published checksum mismatch immediately.

This was accomplished with the following changes:

- Fetch release metadata up to eight times, with a 15-second request
timeout and 15 seconds between attempts. Report any filenames still
missing when retries run out.
- Compare every listed distribution against its local SHA-256 on each
attempt, even when a different wheel or the source archive is missing.

### Testing

Five regression tests passed, covering complete metadata, delayed files,
persistent omissions, a mismatched digest in a partial listing, and a
transient request error. The existing stable publishing checks also
passed.
This commit is contained in:
Bruno Ramirez
2026-12-02 21:05:48 +00:00
committed by GitHub
parent c322048150
commit ff7a1c2c25
3 changed files with 133 additions and 9 deletions
+10 -9
View File
@@ -71,7 +71,9 @@ jobs:
with:
python-version: '3.13'
- name: Test stable publishing checks
run: bash ci/cli_wheel/test_publish_checks.sh
run: |
bash ci/cli_wheel/test_publish_checks.sh
python -m unittest discover -s ci/cli_wheel -p test_verify_pypi.py
- run: python -m pip install wheel==0.48.0 build
- name: Build wheels from published release archives
env:
@@ -191,7 +193,13 @@ jobs:
concurrency: pypi-lancedb-tools-${{ github.event.workflow_run.head_branch || inputs.tag }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
sparse-checkout: ci/cli_wheel/verify_pypi.py
sparse-checkout-cone-mode: false
- uses: actions/download-artifact@v8
with:
pattern: lancedb-tools-*
@@ -203,11 +211,4 @@ jobs:
# A retry of this job can finish a partially uploaded release.
skip-existing: true
- name: Verify the published distribution checksums
working-directory: dist
run: |
curl --fail --silent --show-error --retry 5 --retry-all-errors \
"https://pypi.org/pypi/lancedb-tools/${CLI_TAG#v}/json" -o "$RUNNER_TEMP/pypi.json"
for file in *.whl *.tar.gz; do
digest=$(jq -er --arg file "$file" '.urls[] | select(.filename == $file) | .digests.sha256' "$RUNNER_TEMP/pypi.json")
echo "$digest $file" | sha256sum --check
done
run: python3 ci/cli_wheel/verify_pypi.py "${CLI_TAG#v}" dist