-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
⬆ Upgrade Starlette from 0.17.1 to 0.18.0 #4483
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4483 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 531 531
Lines 13627 13630 +3
=========================================
+ Hits 13627 13630 +3
Continue to review full report at Codecov.
|
📝 Docs preview for commit e5c9343 at: https://61f176cddc1930f5b39fe9cd--fastapi.netlify.app |
fastapi/dependencies/utils.py
Outdated
if response is None: | ||
response = Response() | ||
del response.headers["content-length"] | ||
response.status_code = None |
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.
@tomchristie FastAPI uses a Response
object that travels through the dependencies, but that Response
is not the response that will be returned at the end. There's a "cleanup" after the dependencies are solved. You can see the "cleanup" logic below:
I've selected the whole snippet, from the point we get the Response
object used in the dependencies (solve_dependencies
call) until the last 5 lines (on which the values from Response
are passed to the actual response object that will be used.
This comment is JFYK, I don't expect any action to be taken on Starlette. Also, considering that FastAPI tweaks Starlette internally for some features it has.
📝 Docs preview for commit 8d10fca at: https://61f178c33b56fbf00cd761e2--fastapi.netlify.app |
@@ -126,7 +126,7 @@ async def serialize_response( | |||
if is_coroutine: | |||
value, errors_ = field.validate(response_content, {}, loc=("response",)) | |||
else: | |||
value, errors_ = await run_in_threadpool( | |||
value, errors_ = await run_in_threadpool( # type: ignore[misc] |
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.
We added ParamSpec
to run_in_threadpool
on Starlette. The error here was:
fastapi/routing.py:129: error: "<nothing>" object is not iterable [misc]
📝 Docs preview for commit fb2fdf5 at: https://61f17c4d603b5ade0e34ca0d--fastapi.netlify.app |
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.
@Kludex 🌟
can this get merged soon and released please? |
Starlette 0.19.0 has now been released, not sure if it's worth performing a further upgrade here, or leaving that for another time. |
As per history, Sebastián prefers to bump progressively. Also, those two releases have a lot of changes. |
Hello ! |
Let's wait for @tiangolo :) |
📝 Docs preview for commit e7087f5 at: https://62743b753fbbb2094bed5235--fastapi.netlify.app |
📝 Docs preview for commit 25feb07 at: https://62744bdcedfeb0165d6951ed--fastapi.netlify.app |
Awesome @Kludex, thank you! 🙇 I added a filterwarning for pytest complaining about Cryptography so we can run tests while reaching the version that drops support for Python 3.6. This will be available in the next release in a couple of hours, FastAPI |
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
For reference, set of changes that broke FastAPI:
Content-Length
header forContent-Length: 0
cases encode/starlette#1395Related to #4477