Skip to content

Commit de5fe6b

Browse files
committed
reformat
1 parent 4f970fd commit de5fe6b

File tree

14 files changed

+22
-33
lines changed

14 files changed

+22
-33
lines changed

docs/examples/request_data/request_data_10.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
from typing import Annotated, Any, Dict, List, Tuple
2-
3-
from typing_extensions import Annotated
1+
from typing import Annotated, Any
42

53
from litestar import Litestar, post
64
from litestar.datastructures import UploadFile
@@ -11,7 +9,7 @@
119
@post(path="/")
1210
async def handle_file_upload(
1311
data: Annotated[list[UploadFile], Body(media_type=RequestEncodingType.MULTI_PART)],
14-
) -> dict[str, Tuple[str, str, Any]]:
12+
) -> dict[str, tuple[str, str, Any]]:
1513
result = {}
1614
for file in data:
1715
content = await file.read()

docs/examples/request_data/request_data_5.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
from dataclasses import dataclass
2-
from typing import Dict
3-
42
from typing import Annotated
53

64
from litestar import Litestar, post
@@ -19,7 +17,7 @@ class User:
1917
@post(path="/")
2018
async def create_user(
2119
data: Annotated[User, Body(media_type=RequestEncodingType.MULTI_PART)],
22-
) -> Dict[str, str]:
20+
) -> dict[str, str]:
2321
content = await data.form_input_name.read()
2422
filename = data.form_input_name.filename
2523
return {"id": data.id, "name": data.name, "filename": filename, "size": len(content)}

docs/examples/request_data/request_data_8.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Dict, Annotated, Any
1+
from typing import Annotated
22

33
from pydantic import BaseModel, ConfigDict
44

docs/examples/websockets/stream_and_receive_listener.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from contextlib import asynccontextmanager
21
from collections.abc import AsyncGenerator
2+
from contextlib import asynccontextmanager
33
from typing import Any
44

55
import anyio

docs/examples/websockets/stream_and_receive_raw.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import asyncio
2-
import time
31
from collections.abc import AsyncGenerator
4-
from typing import Any, AsyncGenerator
2+
from typing import Any
53

64
import anyio
75

litestar/_kwargs/cleanup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717

1818

1919
if TYPE_CHECKING:
20-
from types import TracebackType
21-
2220
from collections.abc import AsyncGenerator, Awaitable, Generator
21+
from types import TracebackType
2322

2423
from litestar.types import AnyGenerator
2524

litestar/dto/base_dto.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import dataclasses
44
import typing
55
from abc import abstractmethod
6+
from collections.abc import Collection
67
from inspect import getmodule
7-
from typing import TYPE_CHECKING, Generic, TypeVar, get_type_hints
8-
from typing import TYPE_CHECKING, Callable, Collection, Generic, TypeVar
8+
from typing import TYPE_CHECKING, Callable, Generic, TypeVar, get_type_hints
99

1010
from typing_extensions import NotRequired, TypedDict
1111

litestar/middleware/_internal/exceptions/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from inspect import getmro
44
from sys import exc_info
55
from traceback import format_exception
6-
from typing import TYPE_CHECKING, Any, Type, Union, cast
6+
from typing import TYPE_CHECKING, Any, Union, cast
77

88
from litestar.enums import ScopeType
99
from litestar.exceptions import HTTPException, LitestarException, WebSocketException

litestar/routes/http.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
if TYPE_CHECKING:
1010
from collections.abc import Iterable
1111

12-
from litestar._kwargs import KwargsModel
13-
from litestar.connection import Request
14-
from litestar.types import ASGIApp, HTTPScope, Method, Receive, Scope, Send
1512
from litestar.handlers.http_handlers import HTTPRouteHandler
1613
from litestar.types import Receive, Send
1714
from litestar.types.asgi_types import HttpMethodName

litestar/typing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
NewType,
2424
NotRequired,
2525
Required,
26-
TypeAliasType as TeTypeAliasType,
27-
Self,
2826
get_args,
2927
get_origin,
3028
is_typeddict,
3129
)
30+
from typing_extensions import (
31+
TypeAliasType as TeTypeAliasType,
32+
)
3233

3334
try:
3435
from typing import TypeAliasType # type: ignore[attr-defined]

0 commit comments

Comments
 (0)