Repository navigation
fix(tutorials): retry flaky PyPI fetches in pydantic_ai images - #547
Merged
Merged
Conversation
Both 110_pydantic_ai image builds failed four times when a PyPI download dropped mid-stream during uv pip install, mostly in the emulated arm64 half. uv 0.6.4 doesn't retry that error. Retry the install up to three times (10s, then 20s backoff) and lower parallel downloads to 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danielmillerp
force-pushed
the
dm/retry-pydantic-ai-pypi-fetches
branch
from
October 9, 2026 01:34
c3ea90d to
e7b52f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The two
110_pydantic_aitutorial image builds failed four times when a PyPI download dropped mid-stream inuv pip install("Failed to fetch … broken pipe" or a TLS EOF), mostly in the emulated arm64 half of the build. uv 0.6.4 doesn't retry that error. One failure hit a publish run, so the 00_base:latestimage wasn't updated.In
10_async/00_base/110_pydantic_ai/Dockerfileand10_async/10_temporal/110_pydantic_ai/Dockerfile:uv pip install --system .[dev]…step runs up to 3 times, waiting 10 s and then 20 s between attempts. If all 3 fail, the build still fails.UV_CONCURRENT_DOWNLOADS=4(uv's default is 50), so the slow arm64 build opens fewer connections at once.Not changed: the uv version. All 35 tutorial Dockerfiles pin uv 0.6.4, each on its own line. Bumping two would split the pin, and moving all 35 to 0.12.x is bigger than this fix. That's a separate PR. The publish workflow's platforms are unchanged too.
How this was verified
Retry loop logic: ran the same loop with a stand-in command:
Image builds: this PR's CI builds both images for linux/amd64 and linux/arm64 and runs their tests. I couldn't build them locally because my local Docker disk was full.
Not tested: a real mid-download PyPI failure, which can't be forced on demand.
🤖 Generated with Claude Code

Confidence Score: 5/5
The PR appears safe to merge; both images still fail to build if all install attempts fail.Summary
Both
110_pydantic_aitutorial image builds limit PyPI downloads and retry package installs. This gives temporary download interruptions another chance to recover, especially in the slow emulated arm64 builds.Reviews (3) · Last reviewed commit: "fix(tutorials): retry flaky PyPI fetches..." · Reviewed by Greptile