-
-
Notifications
You must be signed in to change notification settings - Fork 195
Add support for httpx as backend #1085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jakkdl
wants to merge
38
commits into
aio-libs:master
Choose a base branch
from
jakkdl:httpx
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 27 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
1eb6888
Replace aiohttp with httpx
jakkdl d10761c
WIP of full replacement of aiohttp with httpx
jakkdl 3608872
mostly finished WIP of adding httpx support
jakkdl 757819f
fix various test failures
jakkdl 4327b58
fix more parametrization issues
jakkdl e123adc
fix typo current_http_stack -> current_http_backend
jakkdl d029aa4
Add pytest flag for specifying backend when running tests.
jakkdl 8f6bd69
add initial retryable exceptions. _validate_connector_args will now g…
jakkdl bdc680c
yes
jakkdl 48b7310
append coverage when running tests twice
jakkdl b19bc09
Merge branch 'master' into httpx
jakkdl 3e38c06
fix normalization of key paths in urls, revert test
jakkdl 3e29d0d
shuffle around code wrt retryable exception to be less confusing
jakkdl af293b0
Merge remote-tracking branch 'origin/master' into httpx
jakkdl 4482464
Merge remote-tracking branch 'origin/master' into httpx
jakkdl 9dff5be
fix failed merge
jakkdl 746d6b1
ruamel/yaml release pulled, so minor commit to retrigger CI
jakkdl 82f2bc8
pre-merge dir rename
jakkdl 550b660
Merge remote-tracking branch 'origin/master' into httpx
jakkdl 2fd7f29
first fixes after reviews
jakkdl d1c0d12
fix no-httpx ci run
jakkdl 9462503
add HttpxStreamingBody to reduce test changes
jakkdl c5d4592
blah
jakkdl 6b73fbb
Merge remote-tracking branch 'origin/master' into httpx
jakkdl 4d4cf32
make no_httpx a separate matrix entry
jakkdl 6daaa79
Merge branch 'master' into httpx
jakkdl 03da7e7
Merge remote-tracking branch 'origin/master' into HEAD
jakkdl be976f1
error if unknown http backend
jakkdl ae6f1d0
Merge remote-tracking branch 'origin/master' into httpx
jakkdl 041f7f1
add HttpxStreamingChecksumBody to fix tests. But there's probably a n…
jakkdl da5e9fa
fix test_output_compliance fails... as it uses global state 🙃
jakkdl e8ba517
stop using include in CI for conditional vars
jakkdl 7f057b2
quote os value
jakkdl 109a201
remove HttpxAWSResponse, replace with some logic in AioAWSResponse
jakkdl fd8e653
small fixes after review
jakkdl b977370
move skip_httpx to tests/conftest
jakkdl a4ee8c7
improve exception mapping & retryable exceptions
jakkdl e257182
convert iterables to async iterables instead of reading data in send
jakkdl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RuntimeError
per https://github.com/encode/httpx/blob/15e21e9ea3cad4f06e22a7e704aabefdf43d2e29/httpx/_client.py#L901. Unfortunately this will end up catching things like https://github.com/encode/httpx/blob/1805ee0d22f96e2b29f0500dd3076e10020004bf/httpx/_urls.py#L638. At least one area aiohttp is better ;)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see https://github.com/encode/httpx/blob/80960fa31918d7663c3f4c3ad61661cf0e80628f/httpx/_transports/default.py#L78-L91 for more exception mappings, probably want:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider that first RuntimeError actually a bug in httpx if you want to report, it really should be throwing a StreamClosed exception as it already has that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also debating
StreamClosed
, since you're driving this PR if you could look at that one it would be great. It seems like they're using that for control flow instead of exception handling, no-no-no ;)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opened encode/httpx#3575
... although maybe
StreamClosed
is also a bad fit if they're abusing thatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
huh, appear the url in the comment is now broken - this is what I think it was linking to: https://www.python-httpx.org/exceptions/#the-exception-hierarchy
Collapsing your list according to inheritance, the list comes out to
TimeoutException
,ProtocolError
, andConnectError
,ReadError
andWriteError
as the child exceptions ofNetworkError
(but notNetworkError
itself as that would catchCloseError
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are you seeing this?