Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions examples/tutorials/10_async/00_base/110_pydantic_ai/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ RUN apt-get update && apt-get install -y \
RUN uv pip install --system --upgrade pip setuptools wheel

ENV UV_HTTP_TIMEOUT=1000
# Fewer parallel PyPI downloads, so the slow emulated arm64 build drops fewer connections.
ENV UV_CONCURRENT_DOWNLOADS=4

# Copy pyproject.toml and README.md to install dependencies
COPY 10_async/00_base/110_pydantic_ai/pyproject.toml /app/110_pydantic_ai/pyproject.toml
Expand All @@ -37,8 +39,15 @@ COPY 10_async/00_base/110_pydantic_ai/tests /app/110_pydantic_ai/tests
# Copy shared test utilities
COPY test_utils /app/test_utils

# Install the required Python packages with dev dependencies
RUN uv pip install --system .[dev] pytest-asyncio httpx
# Install the required Python packages with dev dependencies.
# Retried because PyPI downloads sometimes drop mid-stream, and this uv
# version doesn't retry that error itself.
RUN for attempt in 1 2 3; do \
uv pip install --system .[dev] pytest-asyncio httpx && exit 0; \
echo "uv pip install failed (attempt $attempt of 3)"; \
[ "$attempt" -lt 3 ] && sleep $((attempt * 10)); \
done; \
exit 1

# Set environment variables
ENV PYTHONPATH=/app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ RUN apt-get update && apt-get install -y \
RUN uv pip install --system --upgrade pip setuptools wheel

ENV UV_HTTP_TIMEOUT=1000
# Fewer parallel PyPI downloads, so the slow emulated arm64 build drops fewer connections.
ENV UV_CONCURRENT_DOWNLOADS=4

COPY 10_async/10_temporal/110_pydantic_ai/pyproject.toml /app/110_pydantic_ai/pyproject.toml
COPY 10_async/10_temporal/110_pydantic_ai/README.md /app/110_pydantic_ai/README.md
Expand All @@ -31,7 +33,14 @@ COPY 10_async/10_temporal/110_pydantic_ai/project /app/110_pydantic_ai/project
COPY 10_async/10_temporal/110_pydantic_ai/tests /app/110_pydantic_ai/tests
COPY test_utils /app/test_utils

RUN uv pip install --system .[dev]
# Retried because PyPI downloads sometimes drop mid-stream, and this uv
# version doesn't retry that error itself.
RUN for attempt in 1 2 3; do \
uv pip install --system .[dev] && exit 0; \
echo "uv pip install failed (attempt $attempt of 3)"; \
[ "$attempt" -lt 3 ] && sleep $((attempt * 10)); \
done; \
exit 1

ENV PYTHONPATH=/app

Expand Down
Loading