]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
⬆ [pre-commit.ci] pre-commit autoupdate (#5709)
authorpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Fri, 10 Mar 2023 18:49:18 +0000 (19:49 +0100)
committerGitHub <noreply@github.com>
Fri, 10 Mar 2023 18:49:18 +0000 (19:49 +0100)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
.pre-commit-config.yaml
docs_src/body_multiple_params/tutorial004.py
docs_src/body_multiple_params/tutorial004_py310.py
docs_src/path_params_numeric_validations/tutorial006.py
fastapi/dependencies/utils.py
fastapi/routing.py
fastapi/security/api_key.py
fastapi/security/oauth2.py
fastapi/security/open_id_connect_url.py
tests/test_tutorial/test_request_files/test_tutorial002_py39.py
tests/test_tutorial/test_request_files/test_tutorial003_py39.py

index 01cd6ea0faa0fc48b052015b08158936b9015882..25e797d246b72f383d149dce04b264a5e79cd057 100644 (file)
@@ -4,7 +4,7 @@ default_language_version:
     python: python3.10
 repos:
 -   repo: https://github.com/pre-commit/pre-commit-hooks
-    rev: v4.3.0
+    rev: v4.4.0
     hooks:
     -   id: check-added-large-files
     -   id: check-toml
@@ -14,14 +14,14 @@ repos:
     -   id: end-of-file-fixer
     -   id: trailing-whitespace
 -   repo: https://github.com/asottile/pyupgrade
-    rev: v3.2.2
+    rev: v3.3.1
     hooks:
     -   id: pyupgrade
         args:
         - --py3-plus
         - --keep-runtime-typing
 -   repo: https://github.com/charliermarsh/ruff-pre-commit
-    rev: v0.0.138
+    rev: v0.0.254
     hooks:
     -   id: ruff
         args:
@@ -38,7 +38,7 @@ repos:
         name: isort (pyi)
         types: [pyi]
 -   repo: https://github.com/psf/black
-    rev: 22.10.0
+    rev: 23.1.0
     hooks:
     -   id: black
 ci:
index beea7d1e38ff89b95418697f7fa416ea84930816..8ce4c7a97658c56b0f1e80d53f1ce54b5aeab63c 100644 (file)
@@ -25,7 +25,7 @@ async def update_item(
     item: Item,
     user: User,
     importance: int = Body(gt=0),
-    q: Union[str, None] = None
+    q: Union[str, None] = None,
 ):
     results = {"item_id": item_id, "item": item, "user": user, "importance": importance}
     if q:
index 6d495d4082352b8c41dbcd6d12f9ac90d7d0f205..14acbc3b4be27849a321c3fcb55a3b6efb401a7f 100644 (file)
@@ -23,7 +23,7 @@ async def update_item(
     item: Item,
     user: User,
     importance: int = Body(gt=0),
-    q: str | None = None
+    q: str | None = None,
 ):
     results = {"item_id": item_id, "item": item, "user": user, "importance": importance}
     if q:
index 85bd6e8b4d258609c6ab3917555031abf032450f..0ea32694ae54b4e1bca435f075f4fbe21db61e17 100644 (file)
@@ -8,7 +8,7 @@ async def read_items(
     *,
     item_id: int = Path(title="The ID of the item to get", ge=0, le=1000),
     q: str,
-    size: float = Query(gt=0, lt=10.5)
+    size: float = Query(gt=0, lt=10.5),
 ):
     results = {"item_id": item_id}
     if q:
index 32e171f188549a2391c4f9dff02c4a17615390c3..a982b071a33c5f6921e33b59bd215f9d3616e4c7 100644 (file)
@@ -696,7 +696,7 @@ async def request_body_to_args(
                     fn: Callable[[], Coroutine[Any, Any, Any]]
                 ) -> None:
                     result = await fn()
-                    results.append(result)
+                    results.append(result)  # noqa: B023
 
                 async with anyio.create_task_group() as tg:
                     for sub_value in value:
index 7e48c8c3ecde3ca33d31949fe226d4ef20450108..c227ea6bae8bc83a94bc4396b996329f17a624f1 100644 (file)
@@ -1250,7 +1250,6 @@ class APIRouter(routing.Router):
             generate_unique_id
         ),
     ) -> Callable[[DecoratedCallable], DecoratedCallable]:
-
         return self.api_route(
             path=path,
             response_model=response_model,
index 24ddbf4825907591ae432a9864ca8fdc82ebd41c..61730187ad1acc4545f8e432794d761deafe25c1 100644 (file)
@@ -18,7 +18,7 @@ class APIKeyQuery(APIKeyBase):
         name: str,
         scheme_name: Optional[str] = None,
         description: Optional[str] = None,
-        auto_error: bool = True
+        auto_error: bool = True,
     ):
         self.model: APIKey = APIKey(
             **{"in": APIKeyIn.query}, name=name, description=description
@@ -45,7 +45,7 @@ class APIKeyHeader(APIKeyBase):
         name: str,
         scheme_name: Optional[str] = None,
         description: Optional[str] = None,
-        auto_error: bool = True
+        auto_error: bool = True,
     ):
         self.model: APIKey = APIKey(
             **{"in": APIKeyIn.header}, name=name, description=description
@@ -72,7 +72,7 @@ class APIKeyCookie(APIKeyBase):
         name: str,
         scheme_name: Optional[str] = None,
         description: Optional[str] = None,
-        auto_error: bool = True
+        auto_error: bool = True,
     ):
         self.model: APIKey = APIKey(
             **{"in": APIKeyIn.cookie}, name=name, description=description
index eb6b4277cf8e3bbeeca3f636d1622d30fbfc2648..dc75dc9febb71cfc949b6367cf0014716bbedf96 100644 (file)
@@ -119,7 +119,7 @@ class OAuth2(SecurityBase):
         flows: Union[OAuthFlowsModel, Dict[str, Dict[str, Any]]] = OAuthFlowsModel(),
         scheme_name: Optional[str] = None,
         description: Optional[str] = None,
-        auto_error: bool = True
+        auto_error: bool = True,
     ):
         self.model = OAuth2Model(flows=flows, description=description)
         self.scheme_name = scheme_name or self.__class__.__name__
index 393614f7cbc3b9bfd51fce7ca23415eca6e83cae..4e65f1f6c486fa579554c61b9d137c7fda1f1b17 100644 (file)
@@ -14,7 +14,7 @@ class OpenIdConnect(SecurityBase):
         openIdConnectUrl: str,
         scheme_name: Optional[str] = None,
         description: Optional[str] = None,
-        auto_error: bool = True
+        auto_error: bool = True,
     ):
         self.model = OpenIdConnectModel(
             openIdConnectUrl=openIdConnectUrl, description=description
index de4127057d1a7f1e52f181b3c031550384a4f33d..633795dee2d697bcf6e4a8bcfaa5cbc3df79b04d 100644 (file)
@@ -150,7 +150,6 @@ def get_app():
 
 @pytest.fixture(name="client")
 def get_client(app: FastAPI):
-
     client = TestClient(app)
     return client
 
index 56aeb54cd10c6690aec39b1c25e5d6ad722b5a1f..474da8ba0fb20cc0f221f61734c9b6c823cfee47 100644 (file)
@@ -152,7 +152,6 @@ def get_app():
 
 @pytest.fixture(name="client")
 def get_client(app: FastAPI):
-
     client = TestClient(app)
     return client