Skip to content

Commit 3291d9f

Browse files
fix: replace AsyncContextManager with AbstractAsyncContextManager to fix UP035 lint error
1 parent 7a922d2 commit 3291d9f

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

archipy/helpers/utils/app_utils.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
import logging
44
from collections.abc import Awaitable, Callable
5+
from contextlib import AbstractAsyncContextManager
56
from http import HTTPStatus
6-
from typing import Any, cast, AsyncContextManager
7+
from typing import Any, cast
78

89
from fastapi import FastAPI, Request, Response
910
from fastapi.exceptions import RequestValidationError
@@ -225,18 +226,18 @@ class AppUtils:
225226

226227
@classmethod
227228
def create_fastapi_app(
228-
cls,
229-
config: BaseConfig | None = None,
230-
*,
231-
configure_exception_handlers: bool = True,
232-
lifespan: Callable[..., AsyncContextManager] | None = None,
229+
cls,
230+
config: BaseConfig | None = None,
231+
*,
232+
configure_exception_handlers: bool = True,
233+
lifespan: Callable[..., AbstractAsyncContextManager] | None = None,
233234
) -> FastAPI:
234235
"""Creates and configures a FastAPI application.
235236
236237
Args:
237238
config (BaseConfig | None): Optional custom configuration. If not provided, uses global config.
238239
configure_exception_handlers (bool): Whether to configure exception handlers.
239-
lifespan (Callable[..., AsyncContextManager] | None): Optional lifespan context manager for the app.
240+
lifespan: Callable[..., AbstractAsyncContextManager] | None = None,
240241
241242
Returns:
242243
FastAPI: The configured FastAPI application instance.

0 commit comments

Comments
 (0)