Skip to content

fix(deps): add httpx2 to dev extras for starlette>=1.10 TestClient - #10

Merged
codesphere-u merged 1 commit into
mainfrom
fix/httpx2-dev-dependency
Nov 24, 2026
Merged

codesphere-u merged 1 commit into
mainfrom
fix/httpx2-dev-dependency

Conversation

@codesphere-u

Copy link
Copy Markdown
Owner

Problem

A fresh install cannot run the test suite: starlette.testclient module requires the httpx2 package. Three test modules (test_otlp_and_alerts, test_server_hardening, test_stackpulse) fail at collection.

starlette 1.10 moved TestClient onto httpx2; the dev extra still pinned legacy httpx.

Why CI was green

The committed uv.lock pins an older Starlette, so uv sync never exercised the broken declaration.

Change

  • declare httpx2>=0.1.0 in the dev extra
  • regenerate uv.lock

Verification

rm -rf .venv && uv lock && uv sync --extra dev && pytest -q → 87 passed (previously a collection error).

Starlette 1.10 moved TestClient onto httpx2. Every repository pinned the
legacy httpx client, so a fresh install resolved a broken test setup:

    RuntimeError: The starlette.testclient module requires the httpx2
    package to be installed.

CI stayed green only because the committed uv.lock pinned an older
Starlette, which masked the broken declaration for new contributors.
Regenerate the lock and declare httpx2 explicitly.

Verified: rm -rf .venv && uv lock && uv sync --extra dev && pytest -q -> green.
@codesphere-u
codesphere-u merged commit c479106 into main Nov 24, 2026
5 checks passed
@codesphere-u
codesphere-u deleted the fix/httpx2-dev-dependency branch November 24, 2026 14:00
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