Add support for httpx2 - #239
Open
Klavionik wants to merge 2 commits into
Open
Conversation
|
bagowix
reviewed
Aug 7, 2026
| ] | ||
| dependencies = [ | ||
| "httpx==0.28.*", | ||
| "httpx2==2.*", |
Contributor
There was a problem hiding this comment.
perhaps it's worth doing this as an extra?
Comment on lines
+22
to
+24
| "pytest-httpx requires the httpx2 package to be installed.\n" | ||
| "You can install it with:\n" | ||
| " $ pip install httpx2\n" |
Contributor
There was a problem hiding this comment.
I would leave this choice up to the user and not talk about the need, because migration does not happen so quickly.
"Neither `httpx2` nor the legacy `httpx` package is installed.\n"
"Install `httpx2` with:\n"
" $ pip install httpx2\n"
Contributor
|
@Colin-b Hi! Could we prioritize this, if possible, please? |
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.



Hey! I'm trying to add support for the httpx2 package, following the guidelines from the authors.
This PR allows users of the package to seamlessly migrate their application and test code from httpx, just by updating the package. Users who have no intentions to migrate will be fine as well: the added
_compat.pymodule tries to use httpx2 first, but falls back to httpx.This is a highly anticipated change I assume, so I'm looking forward for a review and any comments/suggestions are very welcome.