Repository navigation
Add HTTPX2 transports - #411
Merged
Merged
Conversation
adamtheturtle
temporarily deployed
to
development
September 7, 2026 15:25 — with
GitHub Actions
Inactive
This branch was previously deployed
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.
Summary
HTTPX2TransportandAsyncHTTPX2Transportwith native HTTPX2 configuration, clients, responses, and exception behaviorThe tests use
pytest-httpx2, whose dedicatedhttpcore2mocker works with RESPX 0.23.1, so this change does not depend on lundberg/respx#317 oralias_httpx().Validation
uv run --extra=dev pytest -q --cov-fail-under=100 --cov=src/ --cov=tests .(259 passed, 100% coverage)Fixes #385
Note
Low Risk
Additive transport layer and dependency with HTTPX remaining default; risk is mainly install surface and callers who mix httpx/httpx2 config objects at transport boundaries.
Overview
Adds opt-in HTTPX2 as an alternate HTTP stack alongside the existing HTTPX default: new
HTTPX2TransportandAsyncHTTPX2Transportwrap pooledhttpx2clients, accept onlyhttpx2limits/proxy/timeoutobjects, and map responses into the sameTransportResponsetype.CoderPadandAsyncCoderPadtreat HTTPX2 transports like HTTPX for lifecycle (close/acloseon the main transport and optionalscreen_transport). Default construction and client APIs are unchanged.Packaging and docs: runtime dependency
httpx2>=2.12.0, devpytest-httpx2, README/Sphinx sections on migration and separate Screen transport; Sphinx nitpick ignores forhttpx2config types.Reviewed by Cursor Bugbot for commit be772b3. Bugbot is set up for automated code reviews on this repo. Configure here.