Skip to content

Commit 372145e

Browse files
authored
Merge pull request #769 from python-openapi/dependabot/pip/black-24.1.1
Bump black from 23.11.0 to 24.1.1
2 parents c38cbab + efd4f62 commit 372145e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+130
-100
lines changed

openapi_core/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core module"""
2+
23
from openapi_core.app import OpenAPI
34
from openapi_core.configurations import Config
45
from openapi_core.shortcuts import unmarshal_apicall_request

openapi_core/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core app module"""
2+
23
from pathlib import Path
34
from typing import Optional
45

openapi_core/contrib/aiohttp/requests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""OpenAPI core contrib aiohttp requests module"""
2+
23
from __future__ import annotations
34

45
from aiohttp import web
56

67
from openapi_core.datatypes import RequestParameters
78

89

9-
class Empty:
10-
...
10+
class Empty: ...
1111

1212

1313
_empty = Empty()

openapi_core/contrib/django/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib django module"""
2+
23
from openapi_core.contrib.django.requests import DjangoOpenAPIRequest
34
from openapi_core.contrib.django.responses import DjangoOpenAPIResponse
45

openapi_core/contrib/django/handlers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib django handlers module"""
2+
23
from typing import Any
34
from typing import Callable
45
from typing import Dict

openapi_core/contrib/django/middlewares.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib django middlewares module"""
2+
23
import warnings
34
from typing import Callable
45

openapi_core/contrib/django/requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib django requests module"""
2+
23
import re
34
from typing import Optional
45

openapi_core/contrib/django/responses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib django responses module"""
2+
23
from itertools import tee
34

45
from django.http.response import HttpResponse

openapi_core/contrib/falcon/handlers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib falcon handlers module"""
2+
23
from json import dumps
34
from typing import Any
45
from typing import Dict

openapi_core/contrib/falcon/middlewares.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib falcon middlewares module"""
2+
23
from typing import Any
34
from typing import Type
45
from typing import Union
@@ -24,9 +25,9 @@
2425

2526
class FalconOpenAPIMiddleware(FalconIntegration):
2627
valid_request_handler_cls = FalconOpenAPIValidRequestHandler
27-
errors_handler_cls: Type[
28+
errors_handler_cls: Type[FalconOpenAPIErrorsHandler] = (
2829
FalconOpenAPIErrorsHandler
29-
] = FalconOpenAPIErrorsHandler
30+
)
3031

3132
def __init__(
3233
self,

openapi_core/contrib/falcon/requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib falcon responses module"""
2+
23
import warnings
34
from json import dumps
45
from typing import Any

openapi_core/contrib/falcon/responses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib falcon responses module"""
2+
23
from itertools import tee
34

45
from falcon.response import Response

openapi_core/contrib/flask/decorators.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib flask decorators module"""
2+
23
from functools import wraps
34
from typing import Any
45
from typing import Callable
@@ -20,9 +21,9 @@
2021

2122
class FlaskOpenAPIViewDecorator(FlaskIntegration):
2223
valid_request_handler_cls = FlaskOpenAPIValidRequestHandler
23-
errors_handler_cls: Type[
24+
errors_handler_cls: Type[FlaskOpenAPIErrorsHandler] = (
2425
FlaskOpenAPIErrorsHandler
25-
] = FlaskOpenAPIErrorsHandler
26+
)
2627

2728
def __init__(
2829
self,

openapi_core/contrib/flask/handlers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib flask handlers module"""
2+
23
from typing import Any
34
from typing import Callable
45
from typing import Dict

openapi_core/contrib/flask/providers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib flask providers module"""
2+
23
from typing import Any
34

45
from flask.globals import request

openapi_core/contrib/flask/requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib flask requests module"""
2+
23
from flask.wrappers import Request
34
from werkzeug.datastructures import Headers
45
from werkzeug.datastructures import ImmutableMultiDict

openapi_core/contrib/flask/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib flask views module"""
2+
23
from typing import Any
34

45
from flask.views import MethodView

openapi_core/contrib/requests/requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib requests requests module"""
2+
23
from typing import Optional
34
from typing import Union
45
from urllib.parse import parse_qs

openapi_core/contrib/requests/responses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib requests responses module"""
2+
23
from requests import Response
34
from werkzeug.datastructures import Headers
45

openapi_core/contrib/starlette/handlers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib starlette handlers module"""
2+
23
from typing import Any
34
from typing import Dict
45
from typing import Iterable

openapi_core/contrib/starlette/integrations.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ async def get_openapi_response(
2929
response.body_iterator = body_iter2
3030
data = b"".join(
3131
[
32-
chunk.encode(response.charset)
33-
if not isinstance(chunk, bytes)
34-
else chunk
32+
(
33+
chunk.encode(response.charset)
34+
if not isinstance(chunk, bytes)
35+
else chunk
36+
)
3537
async for chunk in body_iter1
3638
]
3739
)

openapi_core/contrib/starlette/middlewares.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib starlette middlewares module"""
2+
23
from starlette.middleware.base import BaseHTTPMiddleware
34
from starlette.middleware.base import RequestResponseEndpoint
45
from starlette.requests import Request

openapi_core/contrib/starlette/requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib starlette requests module"""
2+
23
from typing import Optional
34

45
from starlette.requests import Request

openapi_core/contrib/starlette/responses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib starlette responses module"""
2+
23
from typing import Optional
34

45
from starlette.datastructures import Headers

openapi_core/contrib/werkzeug/requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib werkzeug requests module"""
2+
23
import re
34
from typing import Optional
45

openapi_core/contrib/werkzeug/responses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core contrib werkzeug responses module"""
2+
23
from itertools import tee
34

45
from werkzeug.datastructures import Headers

openapi_core/datatypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core validation request datatypes module"""
2+
23
from __future__ import annotations
34

45
from dataclasses import dataclass

openapi_core/extensions/models/factories.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI X-Model extension factories module"""
2+
23
from dataclasses import make_dataclass
34
from pydoc import locate
45
from typing import Any

openapi_core/protocols.py

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core protocols module"""
2+
23
from typing import Any
34
from typing import Mapping
45
from typing import Optional
@@ -13,16 +14,13 @@ class BaseRequest(Protocol):
1314
parameters: RequestParameters
1415

1516
@property
16-
def method(self) -> str:
17-
...
17+
def method(self) -> str: ...
1818

1919
@property
20-
def body(self) -> Optional[bytes]:
21-
...
20+
def body(self) -> Optional[bytes]: ...
2221

2322
@property
24-
def content_type(self) -> str:
25-
...
23+
def content_type(self) -> str: ...
2624

2725

2826
@runtime_checkable
@@ -54,12 +52,10 @@ class Request(BaseRequest, Protocol):
5452
"""
5553

5654
@property
57-
def host_url(self) -> str:
58-
...
55+
def host_url(self) -> str: ...
5956

6057
@property
61-
def path(self) -> str:
62-
...
58+
def path(self) -> str: ...
6359

6460

6561
@runtime_checkable
@@ -82,8 +78,7 @@ class WebhookRequest(BaseRequest, Protocol):
8278
"""
8379

8480
@property
85-
def name(self) -> str:
86-
...
81+
def name(self) -> str: ...
8782

8883

8984
@runtime_checkable
@@ -100,8 +95,7 @@ class SupportsPathPattern(Protocol):
10095
"""
10196

10297
@property
103-
def path_pattern(self) -> str:
104-
...
98+
def path_pattern(self) -> str: ...
10599

106100

107101
@runtime_checkable
@@ -120,17 +114,13 @@ class Response(Protocol):
120114
"""
121115

122116
@property
123-
def data(self) -> Optional[bytes]:
124-
...
117+
def data(self) -> Optional[bytes]: ...
125118

126119
@property
127-
def status_code(self) -> int:
128-
...
120+
def status_code(self) -> int: ...
129121

130122
@property
131-
def content_type(self) -> str:
132-
...
123+
def content_type(self) -> str: ...
133124

134125
@property
135-
def headers(self) -> Mapping[str, Any]:
136-
...
126+
def headers(self) -> Mapping[str, Any]: ...

openapi_core/schema/protocols.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66

77
@runtime_checkable
88
class SuportsGetAll(Protocol):
9-
def getall(self, name: str) -> List[Any]:
10-
...
9+
def getall(self, name: str) -> List[Any]: ...
1110

1211

1312
@runtime_checkable
1413
class SuportsGetList(Protocol):
15-
def getlist(self, name: str) -> List[Any]:
16-
...
14+
def getlist(self, name: str) -> List[Any]: ...

openapi_core/shortcuts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core shortcuts module"""
2+
23
from typing import Any
34
from typing import Optional
45
from typing import Union

openapi_core/templating/media_types/finders.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core templating media types finders module"""
2+
23
import fnmatch
34
from typing import Mapping
45
from typing import Tuple

openapi_core/templating/paths/datatypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core templating paths datatypes module"""
2+
23
from collections import namedtuple
34

45
Path = namedtuple("Path", ["path", "path_result"])

openapi_core/templating/paths/finders.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core templating paths finders module"""
2+
23
from typing import Iterator
34
from typing import List
45
from typing import Optional

openapi_core/testing/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core testing module"""
2+
23
from openapi_core.testing.requests import MockRequest
34
from openapi_core.testing.responses import MockResponse
45

openapi_core/testing/requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core testing requests module"""
2+
23
from typing import Any
34
from typing import Dict
45
from typing import Optional

openapi_core/testing/responses.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core testing responses module"""
2+
23
from typing import Any
34
from typing import Dict
45
from typing import Optional

openapi_core/unmarshalling/datatypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core validation datatypes module"""
2+
23
from dataclasses import dataclass
34
from typing import Iterable
45

openapi_core/unmarshalling/integrations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core unmarshalling processors module"""
2+
23
from typing import Generic
34

45
from openapi_core.app import OpenAPI

openapi_core/unmarshalling/processors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core unmarshalling processors module"""
2+
23
from openapi_core.typing import RequestType
34
from openapi_core.typing import ResponseType
45
from openapi_core.unmarshalling.integrations import (

openapi_core/unmarshalling/request/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core unmarshalling request module"""
2+
23
from typing import Mapping
34

45
from openapi_spec_validator.versions import consts as versions

openapi_core/unmarshalling/request/datatypes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI core unmarshalling request datatypes module"""
2+
23
from __future__ import annotations
34

45
from dataclasses import dataclass

0 commit comments

Comments
 (0)