Skip to content

Commit 07124db

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ee7357e commit 07124db

17 files changed

Lines changed: 27 additions & 15 deletions

File tree

examples/aiohttp/dynamic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from aiohttp.abc import Request
22
from aiohttp.web_app import Application
33
from aiohttp.web_response import Response
4+
45
from asphalt.core import Component, Context, inject, resource
56

67

examples/fastapi/dynamic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from asphalt.core import Component, Context, inject, resource
21
from fastapi import FastAPI
32
from fastapi.responses import PlainTextResponse
43

4+
from asphalt.core import Component, Context, inject, resource
5+
56

67
async def root() -> str:
78
return "Hello, world!"

examples/litestar/dynamic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from asphalt.core import Component, Context, require_resource
21
from litestar import Litestar, get
32

3+
from asphalt.core import Component, Context, require_resource
4+
45

56
@get("/")
67
async def root() -> str:

examples/starlette/dynamic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from asphalt.core import Component, Context, inject, resource
21
from starlette.applications import Starlette
32
from starlette.requests import Request
43
from starlette.responses import PlainTextResponse, Response
54

5+
from asphalt.core import Component, Context, inject, resource
6+
67

78
async def root(request: Request) -> Response:
89
return PlainTextResponse("Hello, world!")

src/asphalt/web/aiohttp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from aiohttp.web_request import Request
1010
from aiohttp.web_response import Response
1111
from aiohttp.web_runner import AppRunner, TCPSite
12+
1213
from asphalt.core import (
1314
ContainerComponent,
1415
Context,

src/asphalt/web/asgi3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
Scope,
1616
WebSocketScope,
1717
)
18+
from uvicorn import Config
19+
1820
from asphalt.core import (
1921
ContainerComponent,
2022
Context,
2123
context_teardown,
2224
resolve_reference,
2325
)
24-
from uvicorn import Config
2526

2627
T_Application = TypeVar("T_Application", bound=ASGI3Application)
2728

src/asphalt/web/django.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
from collections.abc import Awaitable, Callable
44

55
from asgiref.typing import ASGI3Application, HTTPScope
6-
from asphalt.core import Context
76
from django.core.handlers.asgi import ASGIHandler, ASGIRequest
87
from django.http import HttpRequest, HttpResponse
98
from django.utils.decorators import async_only_middleware
109

10+
from asphalt.core import Context
11+
1112
from .asgi3 import ASGIComponent
1213

1314

src/asphalt/web/fastapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
from typing import Any, get_type_hints
77

88
from asgiref.typing import ASGI3Application
9-
from asphalt.core import Context, require_resource, resolve_reference
109
from fastapi import Depends, FastAPI
1110
from fastapi.routing import APIRoute, APIWebSocketRoute
1211

12+
from asphalt.core import Context, require_resource, resolve_reference
13+
1314
from .asgi3 import ASGIComponent
1415
from .starlette import AsphaltMiddleware
1516

src/asphalt/web/litestar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
from typing import Any
66

77
from asgiref.typing import ASGI3Application, HTTPScope, WebSocketScope
8-
from asphalt.core import Context, require_resource, resolve_reference
98
from litestar import Litestar, Request
109
from litestar.middleware import AbstractMiddleware
1110
from litestar.types import ControllerRouterHandler, Receive, Scope, Send
1211

12+
from asphalt.core import Context, require_resource, resolve_reference
1313
from asphalt.web.asgi3 import ASGIComponent
1414

1515

src/asphalt/web/starlette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
from typing import Any
55

66
from asgiref.typing import ASGI3Application, HTTPScope, WebSocketScope
7-
from asphalt.core import Context, current_context, resolve_reference
87
from starlette.applications import Starlette
98
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
109
from starlette.requests import Request
1110
from starlette.responses import Response
1211
from starlette.types import Receive, Scope, Send
1312

13+
from asphalt.core import Context, current_context, resolve_reference
1414
from asphalt.web.asgi3 import ASGIComponent
1515

1616

0 commit comments

Comments
 (0)