Repository navigation
Migrate httpx to httpx2 - #16358
Closed
zach-overflow wants to merge 1 commit into
Closed
Migrate httpx to httpx2#16358zach-overflow wants to merge 1 commit into
httpx to httpx2#16358zach-overflow wants to merge 1 commit into
Conversation
Contributor
|
This PR modifies dependency files ( If you need a dependency change, please open a discussion describing what you need and why. Closing this PR automatically. |
Author
|
For posterity, I posted a request in #16186 (comment) to see about reviving this PR given the auto-close policy |
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.
What?
standard,standard-no-fastapi-cloud-cliandallextras fromhttpx >=0.23.0,<1.0.0→httpx2 >=2.0.0, same for thegithub-actionsdependency group.fastapi.testclientitself needs no change — Starlette'sTestClientalready prefershttpx2and falls back tohttpx(Support httpx2 in the test client Kludex/starlette#3291).httpxusage tohttpx2:scripts/sponsors.py,scripts/notify_translations.py, thescripts/playwrightscreenshot helpers, and thedocs_src/async_testsexample.README.mdto namehttpx2and point at https://pydantic.dev/docs/httpx2/.httpxin thetestsgroup, solely so the existingwithout-httpx2CI job still has a client to fall back to.Why?
httpxis unmaintained.httpx2is the maintained fork of0.28.1with the same public API, and Starlette'sTestClientalready prefers it — sofastapi[standard]currently installs the deprecated stack and only avoids the deprecation warning by accident of resolution order.Additional notes
## HTTPXheading inadvanced/async-tests.mdbecomes## HTTPX2, and theadd-permalinks-pages --update-existinghook regenerates anchors from titles, so#httpx→#httpx2. External deep links to that section break; I don't see a way to keep the old anchor without fighting the hook.docs_src/async_tests/app_a_py310/test_main.pynow importshttpx2directly, which is exactly what thewithout-httpx2job uninstalls. I gated its wrapper intests/withpytest.importorskiprather than put a conditional import into example code that users read.httpx2is vowel-final wherehttpxwasn't (HTTPX2'yi,HTTPX2'nin); the other languages may still want a native reviewer's eye.httpx2, and 3344 passed / 18 skipped with it uninstalled.pyproject.tomlanduv.lock, soguard-dependencieswill likely auto-close it — happy to move the proposal back into Swap from httpx to httpx2 #16186 if that's preferred.httpxusage; it did the dependency, source and docs changes and verified both CI paths. I reviewed the diff and wrote this description.