diff --git a/app/core/config.py b/app/core/config.py index 13d382e..efd33f6 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -1,4 +1,5 @@ from pathlib import Path +from typing import ClassVar from pydantic_settings import BaseSettings, SettingsConfigDict @@ -18,7 +19,7 @@ class Settings(BaseSettings): ACCESS_TOKEN_EXPIRE_MINUTES: int = 30 # Database settings - DB_DIR = Path("/app") / "storage" / "db" + DB_DIR: ClassVar[Path] = Path("/app") / "storage" / "db" SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite" diff --git a/migrations/env.py b/migrations/env.py index 4ca63e0..8695f1c 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -1,6 +1,6 @@ import sys -from pathlib import Path from logging.config import fileConfig +from pathlib import Path from alembic import context from sqlalchemy import engine_from_config, pool @@ -9,7 +9,8 @@ from sqlalchemy import engine_from_config, pool project_root = Path(__file__).parent.parent sys.path.insert(0, str(project_root)) -from app.db.base import Base +# Import after adding to path to avoid ModuleNotFoundError +from app.db.base import Base # noqa: E402 # this is the Alembic Config object, which provides # access to the values within the .ini file in use.