|
0 |
From e5c934369bf8f47360ab31e3331f75ac386ec5db Mon Sep 17 00:00:00 2001
|
|
1 |
From: Marcelo Trylesinski <[email protected]>
|
|
2 |
Date: Wed, 26 Jan 2022 17:25:51 +0100
|
|
3 |
Subject: [PATCH 1/4] Bump starlette from 0.17.1 to 0.18.0
|
|
4 |
|
|
5 |
---
|
|
6 |
fastapi/dependencies/utils.py | 11 ++++-------
|
|
7 |
pyproject.toml | 2 +-
|
|
8 |
2 files changed, 5 insertions(+), 8 deletions(-)
|
|
9 |
|
|
10 |
--- a/fastapi/dependencies/utils.py
|
|
11 |
+++ b/fastapi/dependencies/utils.py
|
|
12 |
@@ -462,13 +462,10 @@ async def solve_dependencies(
|
|
13 |
]:
|
|
14 |
values: Dict[str, Any] = {}
|
|
15 |
errors: List[ErrorWrapper] = []
|
|
16 |
- response = response or Response(
|
|
17 |
- content=None,
|
|
18 |
- status_code=None, # type: ignore
|
|
19 |
- headers=None, # type: ignore # in Starlette
|
|
20 |
- media_type=None, # type: ignore # in Starlette
|
|
21 |
- background=None, # type: ignore # in Starlette
|
|
22 |
- )
|
|
23 |
+ if response is None:
|
|
24 |
+ response = Response()
|
|
25 |
+ del response.headers["content-length"]
|
|
26 |
+ response.status_code = None # type: ignore
|
|
27 |
dependency_cache = dependency_cache or {}
|
|
28 |
sub_dependant: Dependant
|
|
29 |
for sub_dependant in dependant.dependencies:
|
|
30 |
--- a/pyproject.toml
|
|
31 |
+++ b/pyproject.toml
|
|
32 |
@@ -35,7 +35,7 @@ classifiers = [
|
|
33 |
"Topic :: Internet :: WWW/HTTP",
|
|
34 |
]
|
|
35 |
requires = [
|
|
36 |
- "starlette ==0.17.1",
|
|
37 |
+ "starlette ==0.18.0",
|
|
38 |
"pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0",
|
|
39 |
]
|
|
40 |
description-file = "README.md"
|
|
41 |
--- a/fastapi/concurrency.py
|
|
42 |
+++ b/fastapi/concurrency.py
|
|
43 |
@@ -25,7 +25,7 @@ async def contextmanager_in_threadpool(
|
|
44 |
try:
|
|
45 |
yield await run_in_threadpool(cm.__enter__)
|
|
46 |
except Exception as e:
|
|
47 |
- ok = await run_in_threadpool(cm.__exit__, type(e), e, None)
|
|
48 |
+ ok: bool = await run_in_threadpool(cm.__exit__, type(e), e, None)
|
|
49 |
if not ok:
|
|
50 |
raise e
|
|
51 |
else:
|
|
52 |
--- a/fastapi/routing.py
|
|
53 |
+++ b/fastapi/routing.py
|
|
54 |
@@ -127,7 +127,7 @@ async def serialize_response(
|
|
55 |
if is_coroutine:
|
|
56 |
value, errors_ = field.validate(response_content, {}, loc=("response",))
|
|
57 |
else:
|
|
58 |
- value, errors_ = await run_in_threadpool(
|
|
59 |
+ value, errors_ = await run_in_threadpool( # type: ignore[misc]
|
|
60 |
field.validate, response_content, {}, loc=("response",)
|
|
61 |
)
|
|
62 |
if isinstance(errors_, ErrorWrapper):
|