diff --git a/debian/changelog b/debian/changelog index 19b758e..f216fae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,10 @@ * New upstream release * debian/control - remove pytest-asyncio from b-d, not needed + * debian/patches/PR4483.patch + - support starlette 0.18.0; Closes: #1005547, #1005635 - -- Sandro Tosi Sat, 26 Feb 2022 22:25:53 -0500 + -- Sandro Tosi Sat, 26 Feb 2022 22:26:13 -0500 fastapi (0.73.0-1) unstable; urgency=medium diff --git a/debian/patches/PR4483.patch b/debian/patches/PR4483.patch new file mode 100644 index 0000000..e00c4f9 --- /dev/null +++ b/debian/patches/PR4483.patch @@ -0,0 +1,63 @@ +From e5c934369bf8f47360ab31e3331f75ac386ec5db Mon Sep 17 00:00:00 2001 +From: Marcelo Trylesinski +Date: Wed, 26 Jan 2022 17:25:51 +0100 +Subject: [PATCH 1/4] Bump starlette from 0.17.1 to 0.18.0 + +--- + fastapi/dependencies/utils.py | 11 ++++------- + pyproject.toml | 2 +- + 2 files changed, 5 insertions(+), 8 deletions(-) + +--- a/fastapi/dependencies/utils.py ++++ b/fastapi/dependencies/utils.py +@@ -462,13 +462,10 @@ async def solve_dependencies( + ]: + values: Dict[str, Any] = {} + errors: List[ErrorWrapper] = [] +- response = response or Response( +- content=None, +- status_code=None, # type: ignore +- headers=None, # type: ignore # in Starlette +- media_type=None, # type: ignore # in Starlette +- background=None, # type: ignore # in Starlette +- ) ++ if response is None: ++ response = Response() ++ del response.headers["content-length"] ++ response.status_code = None # type: ignore + dependency_cache = dependency_cache or {} + sub_dependant: Dependant + for sub_dependant in dependant.dependencies: +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -35,7 +35,7 @@ classifiers = [ + "Topic :: Internet :: WWW/HTTP", + ] + 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", + ] + description-file = "README.md" +--- a/fastapi/concurrency.py ++++ b/fastapi/concurrency.py +@@ -25,7 +25,7 @@ async def contextmanager_in_threadpool( + try: + yield await run_in_threadpool(cm.__enter__) + 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: + raise e + else: +--- a/fastapi/routing.py ++++ b/fastapi/routing.py +@@ -127,7 +127,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] + field.validate, response_content, {}, loc=("response",) + ) + if isinstance(errors_, ErrorWrapper): diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..0dc183f --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +PR4483.patch