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.
Sorry, this pull request was originally made against main instead of develop.
httpx 0.18.0 deprecated the httpx.StatusCode class. This fix allows compatibility with 0.17.1 through at least 0.22.0 vs being stuck on 0.17.1.
Description
Change over from httpx.StatusCode to httpx.codes. This is a drop in replacement for how hyperglass uses httpx in this context.
Related Issues
N/A
Motivation and Context
I effectively maintain a custom distribution on top of CentOS/Rocky Linux. My existing httpx version was later that what was required for hyperglass. The easiest fix was to patch hyperglass so it was compatible with httpx >= 0.17.1 instead of locked into 0.17.1.
Tests
I ran pylint and flake8 against _base.py and no errors showed up in relation to my changes. Manual examination of the 0.17.1 source and 0.22.0 source of httpx indicate that StatusCode() from 0.17.1 was just a wrapper around the httpx.codes Enum.
Manual execution of the exception raising code works with a httpx.codes() instance vs a StatuCode() instance.