diff --git a/.gitignore b/.gitignore index f2c51a8..e814c6b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /fastapi-0.74.0.tar.gz /fastapi-0.74.1.tar.gz /fastapi-0.75.0.tar.gz +/fastapi-0.75.1.tar.gz diff --git a/4054.patch b/4054.patch index 3aa4020..4149921 100644 --- a/4054.patch +++ b/4054.patch @@ -1,4 +1,4 @@ -From 254f10e3c23f8e22c4ac834c5f04d762155a4a24 Mon Sep 17 00:00:00 2001 +From 28b22313f08c2cee5416bae5c47cc6ae48e5be15 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 15 Oct 2021 14:20:08 -0400 Subject: [PATCH] Allow PyYAML 6.x @@ -8,19 +8,19 @@ Subject: [PATCH] Allow PyYAML 6.x 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml -index 50e0afe87e..fca6db271c 100644 +index 46a655a48b..fc5ef7b5b1 100644 --- a/pyproject.toml +++ b/pyproject.toml -@@ -73,7 +73,7 @@ doc = [ - "mdx-include >=1.4.1,<2.0.0", - "mkdocs-markdownextradata-plugin >=0.1.7,<0.3.0", - "typer-cli >=0.0.12,<0.0.13", +@@ -77,7 +77,7 @@ doc = [ + # TODO: upgrade and enable typer-cli once it supports Click 8.x.x + # "typer-cli >=0.0.12,<0.0.13", + "typer >=0.4.1,<0.5.0", - "pyyaml >=5.3.1,<6.0.0" + "pyyaml >=5.3.1,<7.0.0" ] dev = [ "python-jose[cryptography] >=3.3.0,<4.0.0", -@@ -87,7 +87,7 @@ all = [ +@@ -91,7 +91,7 @@ all = [ "jinja2 >=2.11.2,<4.0.0", "python-multipart >=0.0.5,<0.0.6", "itsdangerous >=1.1.0,<3.0.0", diff --git a/4488.patch b/4488.patch deleted file mode 100644 index 0bf8002..0000000 --- a/4488.patch +++ /dev/null @@ -1,491 +0,0 @@ -From e5c934369bf8f47360ab31e3331f75ac386ec5db Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Wed, 26 Jan 2022 17:25:51 +0100 -Subject: [PATCH 01/18] 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(-) - -diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py -index d4028d067b..d0a4040ef7 100644 ---- 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 - dependency_cache = dependency_cache or {} - sub_dependant: Dependant - for sub_dependant in dependant.dependencies: -diff --git a/pyproject.toml b/pyproject.toml -index 77c01322fe..867f545acd 100644 ---- 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" - -From 8d10fcabb93d201d57f376350e4a12ac8feaaf5a Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Wed, 26 Jan 2022 17:34:44 +0100 -Subject: [PATCH 02/18] Fix linter - ---- - fastapi/dependencies/utils.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py -index d0a4040ef7..9dccd354ef 100644 ---- a/fastapi/dependencies/utils.py -+++ b/fastapi/dependencies/utils.py -@@ -465,7 +465,7 @@ async def solve_dependencies( - if response is None: - response = Response() - del response.headers["content-length"] -- response.status_code = None -+ response.status_code = None # type: ignore - dependency_cache = dependency_cache or {} - sub_dependant: Dependant - for sub_dependant in dependant.dependencies: - -From 7331e081679b1feba82aa848965baa6b8dcf85ac Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Wed, 26 Jan 2022 17:48:50 +0100 -Subject: [PATCH 03/18] Fix mypy - ---- - fastapi/concurrency.py | 4 ++-- - fastapi/routing.py | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/fastapi/concurrency.py b/fastapi/concurrency.py -index 04382c69e4..11732dd063 100644 ---- a/fastapi/concurrency.py -+++ b/fastapi/concurrency.py -@@ -1,5 +1,5 @@ - import sys --from typing import AsyncGenerator, ContextManager, TypeVar -+from typing import AsyncGenerator, ContextManager, Optional, TypeVar - - from starlette.concurrency import iterate_in_threadpool as iterate_in_threadpool # noqa - from starlette.concurrency import run_in_threadpool as run_in_threadpool # noqa -@@ -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: -diff --git a/fastapi/routing.py b/fastapi/routing.py -index f6d5370d6a..1f5cab9c41 100644 ---- a/fastapi/routing.py -+++ b/fastapi/routing.py -@@ -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] - field.validate, response_content, {}, loc=("response",) - ) - if isinstance(errors_, ErrorWrapper): - -From fb2fdf5d17afb2cd436594cc7e1c5d924b7ab5a9 Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Wed, 26 Jan 2022 17:50:14 +0100 -Subject: [PATCH 04/18] Remove unused Optional import - ---- - fastapi/concurrency.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fastapi/concurrency.py b/fastapi/concurrency.py -index 11732dd063..becac3f33d 100644 ---- a/fastapi/concurrency.py -+++ b/fastapi/concurrency.py -@@ -1,5 +1,5 @@ - import sys --from typing import AsyncGenerator, ContextManager, Optional, TypeVar -+from typing import AsyncGenerator, ContextManager, TypeVar - - from starlette.concurrency import iterate_in_threadpool as iterate_in_threadpool # noqa - from starlette.concurrency import run_in_threadpool as run_in_threadpool # noqa - -From c096ac6e58c72331d6d2218f83dd8bd978d0b1fb Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Thu, 27 Jan 2022 20:22:54 +0100 -Subject: [PATCH 05/18] Bump starlette from 0.18.0 to 0.19.0 - ---- - tests/test_extra_routes.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tests/test_extra_routes.py b/tests/test_extra_routes.py -index 6aba3e8dda..7b824f8874 100644 ---- a/tests/test_extra_routes.py -+++ b/tests/test_extra_routes.py -@@ -32,12 +32,12 @@ def delete_item(item_id: str, item: Item): - - @app.head("/items/{item_id}") - def head_item(item_id: str): -- return JSONResponse(headers={"x-fastapi-item-id": item_id}) -+ return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) - - - @app.options("/items/{item_id}") - def options_item(item_id: str): -- return JSONResponse(headers={"x-fastapi-item-id": item_id}) -+ return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) - - - @app.patch("/items/{item_id}") -@@ -47,7 +47,7 @@ def patch_item(item_id: str, item: Item): - - @app.trace("/items/{item_id}") - def trace_item(item_id: str): -- return JSONResponse(media_type="message/http") -+ return JSONResponse(None, media_type="message/http") - - - client = TestClient(app) - -From a96de7f0cfb437227fdfc257665192edf0a1b667 Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Thu, 27 Jan 2022 20:23:58 +0100 -Subject: [PATCH 06/18] Add starlette master branch - ---- - pyproject.toml | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/pyproject.toml b/pyproject.toml -index 867f545acd..23dc7dc1f9 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -35,7 +35,7 @@ classifiers = [ - "Topic :: Internet :: WWW/HTTP", - ] - requires = [ -- "starlette ==0.18.0", -+ "starlette @ git+ssh://git@github.com/encode/starlette@master#egg=starlette", - "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" -@@ -75,7 +75,7 @@ doc = [ - "mdx-include >=1.4.1,<2.0.0", - "mkdocs-markdownextradata-plugin >=0.1.7,<0.3.0", - "typer-cli >=0.0.12,<0.0.13", -- "pyyaml >=5.3.1,<6.0.0" -+ "pyyaml >=5.3.1,<6.0.0", - ] - dev = [ - "python-jose[cryptography] >=3.3.0,<4.0.0", -@@ -128,10 +128,7 @@ ignore_missing_imports = true - check_untyped_defs = true - - [tool.pytest.ini_options] --addopts = [ -- "--strict-config", -- "--strict-markers", --] -+addopts = ["--strict-config", "--strict-markers"] - xfail_strict = true - junit_family = "xunit2" - filterwarnings = [ - -From cc64170f3ff2e20d9c3ece7f1ff057d3c7138860 Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Thu, 27 Jan 2022 20:25:31 +0100 -Subject: [PATCH 07/18] Undo some changes - ---- - pyproject.toml | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index 23dc7dc1f9..11bca9a624 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -128,7 +128,10 @@ ignore_missing_imports = true - check_untyped_defs = true - - [tool.pytest.ini_options] --addopts = ["--strict-config", "--strict-markers"] -+addopts = [ -+ "--strict-config", -+ "--strict-markers" -+] - xfail_strict = true - junit_family = "xunit2" - filterwarnings = [ - -From 03b0d4cbb1e0fd1cdd17bd643735a3cde1c87138 Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Thu, 27 Jan 2022 20:27:10 +0100 -Subject: [PATCH 08/18] Add version on egg - ---- - pyproject.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index 11bca9a624..7bc0799a1b 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -35,7 +35,7 @@ classifiers = [ - "Topic :: Internet :: WWW/HTTP", - ] - requires = [ -- "starlette @ git+ssh://git@github.com/encode/starlette@master#egg=starlette", -+ "starlette @ git+ssh://git@github.com/encode/starlette@master#egg=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" - -From facb6d8e25e4422fb97bb46f1dc911d90f3a64b7 Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Thu, 27 Jan 2022 20:29:25 +0100 -Subject: [PATCH 09/18] Try with only link - ---- - pyproject.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index 7bc0799a1b..bf84faa26e 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -35,7 +35,7 @@ classifiers = [ - "Topic :: Internet :: WWW/HTTP", - ] - requires = [ -- "starlette @ git+ssh://git@github.com/encode/starlette@master#egg=starlette-0.18.0", -+ "git+https://github.com/encode/starlette.git#master", - "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" - -From a659c2b9920fba1555ed6d41b8939d57f39f9d83 Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Thu, 27 Jan 2022 20:31:08 +0100 -Subject: [PATCH 10/18] Add starlette back - ---- - pyproject.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index bf84faa26e..eb2f17c4c4 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -35,7 +35,7 @@ classifiers = [ - "Topic :: Internet :: WWW/HTTP", - ] - requires = [ -- "git+https://github.com/encode/starlette.git#master", -+ "starlette @ git+https://github.com/encode/starlette.git#master", - "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" - -From 4305a0c5f9bcd1ece36ed858960326bb06d0627a Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Thu, 27 Jan 2022 20:33:01 +0100 -Subject: [PATCH 11/18] Remove HTTPException - ---- - fastapi/exceptions.py | 16 ++-------------- - 1 file changed, 2 insertions(+), 14 deletions(-) - -diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py -index f4a837bb4e..0cc8efceba 100644 ---- a/fastapi/exceptions.py -+++ b/fastapi/exceptions.py -@@ -1,20 +1,8 @@ --from typing import Any, Dict, Optional, Sequence, Type -+from typing import Any, Sequence, Type - - from pydantic import BaseModel, ValidationError, create_model - from pydantic.error_wrappers import ErrorList --from starlette.exceptions import HTTPException as StarletteHTTPException -- -- --class HTTPException(StarletteHTTPException): -- def __init__( -- self, -- status_code: int, -- detail: Any = None, -- headers: Optional[Dict[str, Any]] = None, -- ) -> None: -- super().__init__(status_code=status_code, detail=detail) -- self.headers = headers -- -+from starlette.exceptions import HTTPException as HTTPException - - RequestErrorModel: Type[BaseModel] = create_model("Request") - WebSocketErrorModel: Type[BaseModel] = create_model("WebSocket") - -From b19e84832c95928870a2459e451bf4e2d39f4c64 Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Thu, 27 Jan 2022 20:35:26 +0100 -Subject: [PATCH 12/18] Add noqa on reimport - ---- - fastapi/exceptions.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/fastapi/exceptions.py b/fastapi/exceptions.py -index 0cc8efceba..628c2b742c 100644 ---- a/fastapi/exceptions.py -+++ b/fastapi/exceptions.py -@@ -2,7 +2,7 @@ - - from pydantic import BaseModel, ValidationError, create_model - from pydantic.error_wrappers import ErrorList --from starlette.exceptions import HTTPException as HTTPException -+from starlette.exceptions import HTTPException as HTTPException # noqa - - RequestErrorModel: Type[BaseModel] = create_model("Request") - WebSocketErrorModel: Type[BaseModel] = create_model("WebSocket") - -From 09c70c43c79cc4820f4359f58c7ad68d2cad797d Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Sun, 30 Jan 2022 17:13:56 +0100 -Subject: [PATCH 14/18] Update pyproject.toml - ---- - pyproject.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index eb2f17c4c4..b1f6004f05 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -75,7 +75,7 @@ doc = [ - "mdx-include >=1.4.1,<2.0.0", - "mkdocs-markdownextradata-plugin >=0.1.7,<0.3.0", - "typer-cli >=0.0.12,<0.0.13", -- "pyyaml >=5.3.1,<6.0.0", -+ "pyyaml >=5.3.1,<6.0.0" - ] - dev = [ - "python-jose[cryptography] >=3.3.0,<4.0.0", - -From 880dd0d2192b8677b274a3ccc6823c76380ad54c Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Tue, 1 Feb 2022 00:31:23 +0100 -Subject: [PATCH 15/18] Update pyproject.toml - ---- - pyproject.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index b1f6004f05..357338d476 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -129,7 +129,7 @@ check_untyped_defs = true - - [tool.pytest.ini_options] - addopts = [ -- "--strict-config", -+ "--strict-config", - "--strict-markers" - ] - xfail_strict = true - -From c48a3993572fea39da012e8b5cf9e166a2364645 Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Tue, 1 Feb 2022 15:46:19 +0100 -Subject: [PATCH 16/18] Update pyproject.toml - ---- - pyproject.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index 357338d476..f513254be7 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -130,7 +130,7 @@ check_untyped_defs = true - [tool.pytest.ini_options] - addopts = [ - "--strict-config", -- "--strict-markers" -+ "--strict-markers" - ] - xfail_strict = true - junit_family = "xunit2" - -From 7b519b80bf35aba73a39326b82d1b8be8ae45beb Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Wed, 2 Feb 2022 00:03:09 +0100 -Subject: [PATCH 17/18] Update pyproject.toml - ---- - pyproject.toml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index f513254be7..e10b424b67 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -130,7 +130,7 @@ check_untyped_defs = true - [tool.pytest.ini_options] - addopts = [ - "--strict-config", -- "--strict-markers" -+ "--strict-markers", - ] - xfail_strict = true - junit_family = "xunit2" - -From d382aa5e6b54eb220f2d574c09f57520ddd08d7c Mon Sep 17 00:00:00 2001 -From: Marcelo Trylesinski -Date: Wed, 16 Mar 2022 17:19:34 +0100 -Subject: [PATCH 18/18] Ignore WSGIMiddleware deprecation warning on tests - ---- - pyproject.toml | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/pyproject.toml b/pyproject.toml -index e10b424b67..baff85ebdb 100644 ---- a/pyproject.toml -+++ b/pyproject.toml -@@ -35,7 +35,7 @@ classifiers = [ - "Topic :: Internet :: WWW/HTTP", - ] - requires = [ -- "starlette @ git+https://github.com/encode/starlette.git#master", -+ "starlette==0.19.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" -@@ -138,4 +138,5 @@ filterwarnings = [ - "error", - # 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:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette' - ] diff --git a/fastapi-0.75.1-pr-4488.patch b/fastapi-0.75.1-pr-4488.patch new file mode 100644 index 0000000..3de99f5 --- /dev/null +++ b/fastapi-0.75.1-pr-4488.patch @@ -0,0 +1,115 @@ +diff -Naur fastapi-0.75.1-original/fastapi/concurrency.py fastapi-0.75.1/fastapi/concurrency.py +--- fastapi-0.75.1-original/fastapi/concurrency.py 2022-04-01 19:05:52.000000000 -0400 ++++ fastapi-0.75.1/fastapi/concurrency.py 2022-04-08 17:26:09.955414929 -0400 +@@ -25,7 +25,7 @@ + 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: +diff -Naur fastapi-0.75.1-original/fastapi/dependencies/utils.py fastapi-0.75.1/fastapi/dependencies/utils.py +--- fastapi-0.75.1-original/fastapi/dependencies/utils.py 2022-04-01 19:05:52.000000000 -0400 ++++ fastapi-0.75.1/fastapi/dependencies/utils.py 2022-04-08 17:26:46.360849160 -0400 +@@ -462,13 +462,10 @@ + ]: + 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: +diff -Naur fastapi-0.75.1-original/fastapi/exceptions.py fastapi-0.75.1/fastapi/exceptions.py +--- fastapi-0.75.1-original/fastapi/exceptions.py 2022-04-01 19:05:52.000000000 -0400 ++++ fastapi-0.75.1/fastapi/exceptions.py 2022-04-08 17:27:46.572567344 -0400 +@@ -1,19 +1,8 @@ +-from typing import Any, Dict, Optional, Sequence, Type ++from typing import Any, Sequence, Type + + from pydantic import BaseModel, ValidationError, create_model + from pydantic.error_wrappers import ErrorList +-from starlette.exceptions import HTTPException as StarletteHTTPException +- +- +-class HTTPException(StarletteHTTPException): +- def __init__( +- self, +- status_code: int, +- detail: Any = None, +- headers: Optional[Dict[str, Any]] = None, +- ) -> None: +- super().__init__(status_code=status_code, detail=detail) +- self.headers = headers ++from starlette.exceptions import HTTPException as HTTPException # noqa + + + RequestErrorModel: Type[BaseModel] = create_model("Request") +diff -Naur fastapi-0.75.1-original/fastapi/routing.py fastapi-0.75.1/fastapi/routing.py +--- fastapi-0.75.1-original/fastapi/routing.py 2022-04-01 19:05:52.000000000 -0400 ++++ fastapi-0.75.1/fastapi/routing.py 2022-04-08 17:28:12.339874687 -0400 +@@ -127,7 +127,7 @@ + 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 -Naur fastapi-0.75.1-original/pyproject.toml fastapi-0.75.1/pyproject.toml +--- fastapi-0.75.1-original/pyproject.toml 2022-04-01 19:05:52.000000000 -0400 ++++ fastapi-0.75.1/pyproject.toml 2022-04-08 17:28:51.471341433 -0400 +@@ -35,7 +35,7 @@ + "Topic :: Internet :: WWW/HTTP", + ] + requires = [ +- "starlette ==0.17.1", ++ "starlette==0.19.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" +@@ -140,4 +140,5 @@ + "error", + # 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:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette' + ] +diff -Naur fastapi-0.75.1-original/tests/test_extra_routes.py fastapi-0.75.1/tests/test_extra_routes.py +--- fastapi-0.75.1-original/tests/test_extra_routes.py 2022-04-01 19:05:52.000000000 -0400 ++++ fastapi-0.75.1/tests/test_extra_routes.py 2022-04-08 17:35:03.686781085 -0400 +@@ -32,12 +32,12 @@ + + @app.head("/items/{item_id}") + def head_item(item_id: str): +- return JSONResponse(headers={"x-fastapi-item-id": item_id}) ++ return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) + + + @app.options("/items/{item_id}") + def options_item(item_id: str): +- return JSONResponse(headers={"x-fastapi-item-id": item_id}) ++ return JSONResponse(None, headers={"x-fastapi-item-id": item_id}) + + + @app.patch("/items/{item_id}") +@@ -47,7 +47,7 @@ + + @app.trace("/items/{item_id}") + def trace_item(item_id: str): +- return JSONResponse(media_type="message/http") ++ return JSONResponse(None, media_type="message/http") + + + client = TestClient(app) diff --git a/python-fastapi.spec b/python-fastapi.spec index f34308e..c7c5b90 100644 --- a/python-fastapi.spec +++ b/python-fastapi.spec @@ -1,30 +1,17 @@ # For translations, check docs/*/docs/index.md +# Note that there are many other localized versions of the documentation +# *present*, but untranslated. %global sum_en FastAPI framework %global sum_es FastAPI framework -# Missing translation (localized docs present, but untranslated) -# Summary(de): FastAPI framework -# Missing translation (localized docs present, but untranslated) -# Summary(fr): FastAPI framework -# Missing translation (localized docs present, but untranslated) -# Summary(id): FastAPI framework -# Missing translation (localized docs present, but untranslated) -# Summary(it): FastAPI framework -# Translation present, but the title was not translated %global sum_ja FastAPI framework %global sum_ko FastAPI 프레임워크 %global sum_pl FastAPI to szybki %global sum_pt Framework FastAPI -# Missing translation (localized docs present, but untranslated) -# %%global sum_ru FastAPI framework -# Missing translation (localized docs present, but untranslated) -# %%global sum_sq FastAPI framework %global sum_tr FastAPI framework -# Missing translation (localized docs present, but untranslated) -# %%global sum_uk FastAPI framework %global sum_zh FastAPI 框架 Name: python-fastapi -Version: 0.75.0 +Version: 0.75.1 Release: %autorelease Summary: %{sum_en} @@ -40,7 +27,9 @@ BuildArch: noarch # # Bump starlette from 0.17.1 to 0.18.0 # https://github.com/tiangolo/fastapi/pull/4483 -Patch: %{url}/pull/4488.patch +# +# This is a version rebased to apply cleanly to the packaged release. +Patch: fastapi-0.75.1-pr-4488.patch # Allow PyYAML 6.x # https://github.com/tiangolo/fastapi/pull/4054 Patch: %{url}/pull/4054.patch @@ -54,18 +43,11 @@ Obsoletes: python-fastapi-doc < 0.68.1-6 Summary(en): %{sum_en} Summary(es): %{sum_es} -# Summary(de): %%{sum_de} -# Summary(fr): %%{sum_fr} -# Summary(id): %%{sum_id} -# Summary(it): %%{sum_it} Summary(ja): %{sum_ja} Summary(ko): %{sum_ko} Summary(pl): %{sum_pl} Summary(pt): %{sum_pt} -# Summary(ru): %%{sum_ru} -# Summary(sq): %%{sum_sq} Summary(tr): %{sum_tr} -# Summary(uk): %%{sum_uk} Summary(zh): %{sum_zh} %global common_description_en %{expand: @@ -119,10 +101,6 @@ Sus características principales son: * Esta estimación está basada en pruebas con un equipo de desarrollo interno contruyendo aplicaciones listas para producción.} -#%%global common_description_de %%{expand:…} -#%%global common_description_fr %%{expand:…} -#%%global common_description_id %%{expand:…} -#%%global common_description_it %%{expand:…} %global common_description_ja %{expand: FastAPI は、Pythonの標準である型ヒントに基づいてPython 3.6 以降でAPI を構築するための、モダンで、高速(高パフォーマンス)な、Web フレームワークです。 @@ -218,8 +196,6 @@ Os recursos chave são: * estimativas baseadas em testes realizados com equipe interna de desenvolvimento, construindo aplicações em produção.} -#%%global common_description_ru %%{expand:…} -#%%global common_description_sq %%{expand:…} %global common_description_tr %{expand: FastAPI, Python 3.6+'nın standart type hintlerine dayanan modern ve hızlı (yüksek performanslı) API'lar oluşturmak için kullanılabilecek web framework'ü. @@ -244,7 +220,6 @@ Ana özellikleri: * Bahsi geçen rakamsal ifadeler tamamiyle, geliştirme takımının kendi sundukları ürünü geliştirirken yaptıkları testlere dayanmakta.} -#%%global common_description_uk %%{expand:…} %global common_description_zh %{expand: FastAPI 是一个用于构建 API 的现代、快速(高性能)的 web 框架,使用 Python 3.6+ 并基于标准的 Python 类型提示。 @@ -268,18 +243,11 @@ FastAPI 是一个用于构建 API 的现代、快速(高性能)的 web 框� %description -l en %{common_description_en} %description -l es %{common_description_es} -#%%description -l de %%{common_description_de} -#%%description -l fr %%{common_description_fr} -#%%description -l id %%{common_description_id} -#%%description -l it %%{common_description_it} %description -l ja %{common_description_ja} %description -l ko %{common_description_ko} %description -l pl %{common_description_pl} %description -l pt %{common_description_pt} -#%%description -l ru %%{common_description_ru} -#%%description -l sq %%{common_description_sq} %description -l tr %{common_description_tr} -#%%description -l uk %%{common_description_uk} %description -l zh %{common_description_zh} @@ -291,36 +259,22 @@ Summary: %{sum_en} Summary(en): %{sum_en} Summary(es): %%{sum_es} -# Summary(de): %%{sum_de} -# Summary(fr): %%{sum_fr} -# Summary(id): %%{sum_id} -# Summary(it): %%{sum_it} Summary(ja): %{sum_ja} Summary(ko): %{sum_ko} Summary(pl): %{sum_pl} Summary(pt): %{sum_pt} -# Summary(ru): %%{sum_ru} -# Summary(sq): %%{sum_sq} Summary(tr): %{sum_tr} -# Summary(uk): %%{sum_uk} Summary(zh): %{sum_zh} %description -n python3-fastapi %{common_description_en} %description -n python3-fastapi -l en %{common_description_en} %description -n python3-fastapi -l es %{common_description_es} -#%%description -n python3-fastapi -l de %%{common_description_de} -#%%description -n python3-fastapi -l fr %%{common_description_fr} -#%%description -n python3-fastapi -l id %%{common_description_id} -#%%description -n python3-fastapi -l it %%{common_description_it} %description -n python3-fastapi -l ja %{common_description_ja} %description -n python3-fastapi -l ko %{common_description_ko} %description -n python3-fastapi -l pl %{common_description_pl} %description -n python3-fastapi -l pt %{common_description_pt} -#%%description -n python3-fastapi -l ru %%{common_description_ru} -#%%description -n python3-fastapi -l sq %%{common_description_sq} %description -n python3-fastapi -l tr %{common_description_tr} -#%%description -n python3-fastapi -l uk %%{common_description_uk} %description -n python3-fastapi -l zh %{common_description_zh} diff --git a/sources b/sources index ca7ca6a..4abae57 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (fastapi-0.75.0.tar.gz) = deb30523cf326c8490d56738127a6767b0f1fd542a6ddda5d7cb67d0a6e29f27ed7d6ffa72dcf8d69975440adfdb8ccde58d0c6ee38b08448153f1cc0441e368 +SHA512 (fastapi-0.75.1.tar.gz) = 1b0be4d214ffb7e0fa8171e5ea9b101c24712a0ab00ee9fbd39b61dc1e5f9466874e46ceccd6893aa4b316b686dc08e21364024006f4280581ae330db987502b