fix(backend): resolve ty check errors across api, mcp, and lifespan typing
This commit is contained in:
parent
679e4e81f4
commit
389ca5ffdc
6 changed files with 36 additions and 28 deletions
|
|
@ -1,4 +1,5 @@
|
|||
from contextlib import asynccontextmanager
|
||||
from typing import Any, AsyncIterator, Mapping
|
||||
|
||||
from dotenv import load_dotenv
|
||||
|
||||
|
|
@ -7,6 +8,7 @@ load_dotenv() # load .env before db.py reads DATABASE_URL
|
|||
from fastapi import FastAPI # noqa: E402
|
||||
from fastapi.middleware.cors import CORSMiddleware # noqa: E402
|
||||
from fastmcp.utilities.lifespan import combine_lifespans # noqa: E402
|
||||
from starlette.applications import Starlette # noqa: E402
|
||||
|
||||
from db import create_db_and_tables # noqa: E402
|
||||
from innercontext.api import ( # noqa: E402
|
||||
|
|
@ -23,7 +25,7 @@ mcp_app = mcp.http_app(path="/mcp")
|
|||
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
async def lifespan(app: Starlette) -> AsyncIterator[Mapping[str, Any] | None]:
|
||||
create_db_and_tables()
|
||||
yield
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue