mirror of https://github.com/tiangolo/fastapi.git
⬆ Upgrade Starlette from 0.17.1 to 0.18.0 (#4483)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
This commit is contained in:
parent
146f57b8f7
commit
33d61430cf
|
|
@ -25,7 +25,7 @@ async def contextmanager_in_threadpool(
|
||||||
try:
|
try:
|
||||||
yield await run_in_threadpool(cm.__enter__)
|
yield await run_in_threadpool(cm.__enter__)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
ok = await run_in_threadpool(cm.__exit__, type(e), e, None)
|
ok: bool = await run_in_threadpool(cm.__exit__, type(e), e, None)
|
||||||
if not ok:
|
if not ok:
|
||||||
raise e
|
raise e
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -462,13 +462,10 @@ async def solve_dependencies(
|
||||||
]:
|
]:
|
||||||
values: Dict[str, Any] = {}
|
values: Dict[str, Any] = {}
|
||||||
errors: List[ErrorWrapper] = []
|
errors: List[ErrorWrapper] = []
|
||||||
response = response or Response(
|
if response is None:
|
||||||
content=None,
|
response = Response()
|
||||||
status_code=None, # type: ignore
|
del response.headers["content-length"]
|
||||||
headers=None, # type: ignore # in Starlette
|
response.status_code = None # type: ignore
|
||||||
media_type=None, # type: ignore # in Starlette
|
|
||||||
background=None, # type: ignore # in Starlette
|
|
||||||
)
|
|
||||||
dependency_cache = dependency_cache or {}
|
dependency_cache = dependency_cache or {}
|
||||||
sub_dependant: Dependant
|
sub_dependant: Dependant
|
||||||
for sub_dependant in dependant.dependencies:
|
for sub_dependant in dependant.dependencies:
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ async def serialize_response(
|
||||||
if is_coroutine:
|
if is_coroutine:
|
||||||
value, errors_ = field.validate(response_content, {}, loc=("response",))
|
value, errors_ = field.validate(response_content, {}, loc=("response",))
|
||||||
else:
|
else:
|
||||||
value, errors_ = await run_in_threadpool(
|
value, errors_ = await run_in_threadpool( # type: ignore[misc]
|
||||||
field.validate, response_content, {}, loc=("response",)
|
field.validate, response_content, {}, loc=("response",)
|
||||||
)
|
)
|
||||||
if isinstance(errors_, ErrorWrapper):
|
if isinstance(errors_, ErrorWrapper):
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ classifiers = [
|
||||||
"Topic :: Internet :: WWW/HTTP",
|
"Topic :: Internet :: WWW/HTTP",
|
||||||
]
|
]
|
||||||
requires = [
|
requires = [
|
||||||
"starlette ==0.17.1",
|
"starlette ==0.18.0",
|
||||||
"pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0",
|
"pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0",
|
||||||
]
|
]
|
||||||
description-file = "README.md"
|
description-file = "README.md"
|
||||||
|
|
@ -140,4 +140,6 @@ filterwarnings = [
|
||||||
"error",
|
"error",
|
||||||
# TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8
|
# TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8
|
||||||
'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
|
'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
|
||||||
|
# TODO: remove after dropping support for Python 3.6
|
||||||
|
'ignore:Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.:UserWarning:jose',
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue