Repository navigation
[codex] Add httpx2 to standard extras - #15729
sairamveereddy wants to merge 1 commit into
Conversation
|
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. |
|
You can always add |
|
Thanks @SairamVeeereddy I have the same "issue". It is weird that by default fastapi generates the warnings from the recommended ways of working, no? https://github.com/encode/httpx is unmantained and https://github.com/pydantic/httpx2 is maintained by pydantic, wouldn't it be better to depend on httpx2 instead of httpx then? @YuriiMotov is it considered dropping httpx dependency entirely and only depending on httpx2, so basically doing a full transition of the dependency? Thanks in advance 😃 ! |
|
@bonastreyair, thanks! We are aware of this situation and Sebastian took a decision to keep it as it is for now for some reasons. |
Summary
Add
httpx2 >=2.0.0to thestandard,standard-no-fastapi-cloud-cli, andalloptional dependency extras.Why
Current Starlette's
TestClientprefershttpx2. Withouthttpx2installed, importingfastapi.testclient.TestClientcan emit a Starlette deprecation warning while falling back tohttpx. In warning-strict environments, that warning can fail tests or local validation even after installingfastapi[standard].The test and docs dependency groups already include
httpx2; this aligns the public extras with that setup.Validation
python -m pip install -e ".[standard]"python -W error::DeprecationWarning -c "from fastapi.testclient import TestClient; print(TestClient.__name__)"python -m pytest tests\test_request_params\test_path\test_required_str.py tests\test_param_include_in_schema.py -q