Add a migration guide from httpx#1078
Conversation
|
Docs preview: https://a13094b1-httpx2-docs.pydantic.workers.dev |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e30fcc1dd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| * **SSL verification uses the operating system's trust store**, via [`truststore`](https://truststore.readthedocs.io/), instead of `certifi`'s bundled certificates. For most users this just means fewer corporate-proxy headaches. The `SSL_CERT_FILE` and `SSL_CERT_DIR` environment variables are still honored first, and you can still pass `verify=` explicitly. See [SSL](advanced/ssl.md) for details. | ||
| * **Python 3.10 or newer is required**. Support for Python 3.9 was dropped. | ||
| * **Deprecation warnings are visible by default**. `httpx2` uses `HTTPXDeprecationWarning`, a `UserWarning` subclass, so you will actually see deprecations without configuring warning filters. |
There was a problem hiding this comment.
Don’t promise every deprecation is visible
This overstates the current runtime behavior: several active deprecations still emit the built-in DeprecationWarning (for example verify=<str>/cert=... in src/httpx2/httpx2/_config.py, per-request cookies in _client.py, and raw data= bytes in _content.py), which is ignored by default when raised from library code. Users migrating those call sites therefore will not see the warnings without configuring filters, contrary to this guide.
Useful? React with 👍 / 👎.
Summary
Adds a
Migrating from HTTPXdocs page (placed right after QuickStart in the nav), aimed at the two audiences that keep asking about this:httpxandhttpx2coexist in one environment, so migration can be incremental and transitive dependencies keep working. Covers the type boundary (isinstance/exceptdon't cross between the two packages) andalias_httpx()(Addalias_httpx()to aliashttpximports tohttpx2#1077) as the application-level escape hatch, with its rules and limits.httpxwithhttpx2outright, as Replace httpx and httpx-sse with httpx2 modelcontextprotocol/python-sdk#2972 did. If not, preferhttpx2at runtime with anhttpxfallback plus deprecation warning while pointing the install extra athttpx2, as Support httpx2 in the test client Kludex/starlette#3291 did (pattern shown inline).Also documents the visible rename surface (CLI, User-Agent, loggers,
httpcore2) and behavior differences (truststore, Python 3.10+, visible deprecation warnings), ends with a pre-ship checklist, and addsalias_httpxto the API reference.AI Disclaimer
This PR was developed with the assistance of either Claude or Codex. I've reviewed and verified the changes.