Skip to content

fix: pin fasthtml streaming examples#750

Open
JamBalaya56562 wants to merge 1 commit into
aws:mainfrom
JamBalaya56562:fix/fasthtml-streaming-examples-ci
Open

fix: pin fasthtml streaming examples#750
JamBalaya56562 wants to merge 1 commit into
aws:mainfrom
JamBalaya56562:fix/fasthtml-streaming-examples-ci

Conversation

@JamBalaya56562
Copy link
Copy Markdown
Contributor

Description

python-fasthtml==0.5.1 fails to import on python:3.12-slim with ModuleNotFoundError: sqlite_minutils, which broke both response-streaming examples at runtime. Because these examples use a Lambda Function URL with RESPONSE_STREAM and have no API Gateway events, sam local start-api (used by the existing test-image / test-zip jobs) cannot drive them — so they were only lint-validated and the broken pin shipped undetected.

This PR pins the examples to working versions and adds CI coverage that actually builds and runs them.

Changes

  • Bump python-fasthtml to 0.13.4 in both fasthtml-response-streaming and fasthtml-response-streaming-zip examples.
  • Bump anthropic to 0.40.0 in the image example. fasthtml 0.13.4 pulls httpx>=0.28, which dropped the proxies kwarg that anthropic 0.34.1 still passes, causing a TypeError at client construction.
  • Add a test-stream CI job to .github/workflows/examples.yaml that builds and runs each streaming app, then verifies it responds over HTTP:
    • Image example: builds the app image (which COPYs the locally built adapter image) and runs it, mapping the container's 8080 to host 8000. AWS_REGION is set so AnthropicBedrock() can construct without real credentials; GET / only renders a form and never calls Bedrock.
    • Zip example: installs requirements.txt and runs app/main.py directly (the layer paths added by run.sh are only needed at runtime on Lambda).
    • The verify step polls / for up to 90s and asserts a non-5xx HTTP status, dumping app/container logs on failure.

Testing

  • test-stream runs both examples in a matrix (fail-fast: false) and confirms each app starts and serves a valid response.

Why this matters

Without an end-to-end run, the broken python-fasthtml pin passed lint validation and shipped. This job closes that gap for the RESPONSE_STREAM examples that sam local start-api cannot exercise.

…n CI

python-fasthtml==0.5.1 fails to import on python:3.12-slim
(ModuleNotFoundError: sqlite_minutils). Bump both response-streaming
examples to 0.13.4; the image example also needs anthropic 0.40.0
because fasthtml 0.13.4 pulls httpx>=0.28 which dropped the 'proxies'
kwarg that anthropic 0.34.1 passes. Add a test-stream CI job that builds
and runs each app (these use Lambda Function URL RESPONSE_STREAM, which
sam local start-api can't drive).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant