From cb3da3cd38d20e629d8b57455753c768b05dbbec Mon Sep 17 00:00:00 2001 From: Stefan Jansen Date: Sat, 12 Sep 2026 08:15:23 -0400 Subject: [PATCH] release: wait for the simple index before exercising the published wheel The post-release job verified the publication against two different PyPI endpoints and treated them as one. 'Verify PyPI identity and digests' reads https://pypi.org/pypi///json; 'Install and exercise the published wheel' reads https://pypi.org/simple/ through uv. They propagate independently, so the first can pass on a version the second has not listed. Measured on 0.1.7: publish completed 11:59:22Z, the install failed 24s later with 'no version of ml4t-backtest==0.1.7', and a re-run of the same job at 12:03:22Z passed unchanged. Nothing was wrong with the release; the check was faster than the index. Retry the install for up to 12 attempts over 120s, the same budget the deployed-documentation recheck already uses below it, and fail with an explicit message naming the simple index if it never appears. A genuinely absent artifact still fails, two minutes later. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01UPDj1nioTuD4xATMVyhZxB --- .github/workflows/release.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f77c2e3b..2aec3020 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -250,7 +250,20 @@ jobs: - name: Install and exercise the published wheel run: | uv venv --clear --python 3.12 "$RUNNER_TEMP/published-venv" - uv pip install --python "$RUNNER_TEMP/published-venv/bin/python" --index-url https://pypi.org/simple --refresh-package ml4t-backtest "ml4t-backtest==${{ needs.preflight.outputs.version }}" + # The step above reads https://pypi.org/pypi///json; this one reads + # https://pypi.org/simple/. The two endpoints propagate independently, so the JSON + # API can already serve a version the simple index has not listed yet. On 0.1.7 the + # gap was under four minutes and turned a correct publication into a red release run. + attempt=1 + until uv pip install --python "$RUNNER_TEMP/published-venv/bin/python" --index-url https://pypi.org/simple --refresh-package ml4t-backtest "ml4t-backtest==${{ needs.preflight.outputs.version }}"; do + if [ "$attempt" -ge 12 ]; then + echo "::error::ml4t-backtest==${{ needs.preflight.outputs.version }} is still absent from the simple index after $attempt attempts over 120s." + exit 1 + fi + echo "Simple index has not listed ${{ needs.preflight.outputs.version }} yet (attempt $attempt); retrying in 10s." + attempt=$((attempt + 1)) + sleep 10 + done "$RUNNER_TEMP/published-venv/bin/python" -I -c "import ml4t.backtest as package; assert package.__version__ == '${{ needs.preflight.outputs.version }}'" "$RUNNER_TEMP/published-venv/bin/python" validation/check_documentation_examples.py