Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: pycln
- repo: 'https://github.com/psf/black'
rev: 25.11.0
rev: 26.1.0
hooks:
- id: black
args:
Expand Down Expand Up @@ -41,7 +41,7 @@ repos:
args: [--py39-plus, --keep-runtime-typing]

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.37.1
rev: v1.38.0
hooks:
- id: yamllint
args: ["-d", "{extends: relaxed, rules: {empty-lines: disable, line-length: {max: 1500}}}", --strict, --format, parsable]
Expand All @@ -55,7 +55,7 @@ repos:

- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.9.13
rev: 0.9.26
hooks:
# Update the uv lockfile
- id: uv-lock
Expand Down
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import sys
import datetime


sys.path.append(str(p := (Path(".").absolute() / "_ext")))
assert p.exists(), f"{p} {os.getcwd()}"

Expand Down
1 change: 0 additions & 1 deletion src/aiopenapi3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
RequestError,
)


__all__ = [
"__version__",
"OpenAPI",
Expand Down
1 change: 0 additions & 1 deletion src/aiopenapi3/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from .v30.paths import Operation
from .model import is_basemodel, Model


if typing.TYPE_CHECKING:
from ._types import (
RootType,
Expand Down
5 changes: 2 additions & 3 deletions src/aiopenapi3/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from aiopenapi3.errors import ContentLengthExceededError


try:
from contextlib import aclosing
except: # <= Python 3.10
Expand Down Expand Up @@ -369,7 +368,7 @@ def __init__(self, oi: "OperationIndex") -> None:
)

def __getattr__(self, item) -> RequestBase:
(method, path, op, servers) = self._operations[item]
method, path, op, servers = self._operations[item]
return self._oi._api._createRequest(self._oi._api, method, path, op, servers)

class Iter:
Expand Down Expand Up @@ -448,7 +447,7 @@ def __getattr__(self, item: str) -> "RequestType":
if self._use_operation_tags and item in self._tags:
return self._tags[item]
elif item in self._operations:
(method, path, op, servers) = self._operations[item]
method, path, op, servers = self._operations[item]
return self._api._createRequest(self._api, method, path, op, servers)
else:
raise KeyError(f"operationId {item} not found in tags or operations")
Expand Down
1 change: 0 additions & 1 deletion src/aiopenapi3/v30/formdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from .parameter import encode_parameter


if TYPE_CHECKING:
from pydantic import BaseModel
from .._types import MediaTypeType, SchemaType
Expand Down
1 change: 0 additions & 1 deletion src/aiopenapi3/v30/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from ..base import ObjectExtended, ObjectBase, ReferenceBase


if typing.TYPE_CHECKING:
from .schemas import Schema
from .parameter import Parameter
Expand Down
6 changes: 3 additions & 3 deletions src/aiopenapi3/v30/glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,11 @@ def _prepare_body(self, data_: Optional["RequestData"], rbq: dict[str, str]) ->
alias = fh = content_type = None
headers: dict[str, str] = {}
if len(value) == 4:
(alias, fh, content_type, headers) = cast(tuple[str, Any, str, dict[str, str]], value)
alias, fh, content_type, headers = cast(tuple[str, Any, str, dict[str, str]], value)
elif len(value) == 3:
(alias, fh, content_type) = cast(tuple[str, Any, str], value)
alias, fh, content_type = cast(tuple[str, Any, str], value)
elif len(value) == 2:
(alias, fh) = cast(tuple[str, Any], value)
alias, fh = cast(tuple[str, Any], value)
elif len(value) == 1:
fh = cast(Any, value)

Expand Down
1 change: 0 additions & 1 deletion tests/content_length_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import aiopenapi3


app = FastAPI(version="1.0.0", title="TLS tests", servers=[{"url": "/", "description": "Default, relative server"}])


Expand Down
6 changes: 2 additions & 4 deletions tests/formdata_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ def test_formdata_encoding(httpx_mock, with_paths_requestbody_formdata_encoding)

content = request.content.decode()

msg = email.message_from_string(
f"""\
msg = email.message_from_string(f"""\
MIME-Version: 1.0
Content-Type: {request.headers["content-type"]}

{content}

"""
)
""")
assert msg.defects == [] and msg.is_multipart()

r = dict()
Expand Down
1 change: 0 additions & 1 deletion tests/stream_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import aiopenapi3


app = FastAPI(version="1.0.0", title="TLS tests", servers=[{"url": "/", "description": "Default, relative server"}])


Expand Down
8 changes: 2 additions & 6 deletions tests/tls_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,11 @@ class MutualTLSSecurity(Document):
def parsed(self, ctx: "Document.Context") -> "Document.Context":
import yaml

ctx.document["components"] = yaml.safe_load(
io.StringIO(
"""
ctx.document["components"] = yaml.safe_load(io.StringIO("""
securitySchemes:
tls:
type: mutualTLS
"""
)
)
"""))

# /tls - mutual tls authentication
ctx.document["paths"]["/required-tls-authentication"]["get"]["security"] = [{"tls": []}]
Expand Down
Loading