diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e448773b..f2b83f9f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" - - run: pip install ruff mypy + - run: pip install ruff==0.16.6 mypy==2.3.1 - run: ruff check backend/ - run: ruff format --check backend/ @@ -27,8 +27,12 @@ jobs: python-version: "3.12" cache: pip - run: pip install -r backend/requirements.txt - - run: pip install pytest pytest-asyncio httpx + - run: pip install pytest pytest-asyncio httpx aiosqlite - run: pytest tests/ -v + working-directory: backend + env: + DATABASE_URL: sqlite+aiosqlite:///test.db + JWT_SECRET_KEY: ci-test-secret-key docker-build: runs-on: ubuntu-latest diff --git a/backend/dwf/api/routers/auth.py b/backend/dwf/api/routers/auth.py index 5c2c0972..87ebc151 100644 --- a/backend/dwf/api/routers/auth.py +++ b/backend/dwf/api/routers/auth.py @@ -3,13 +3,13 @@ from sqlalchemy.ext.asyncio import AsyncSession from dwf.api.deps import get_db, get_settings -from dwf.services.auth_service import AuthService from dwf.domain.models.user import ( - RegisterRequest, LoginRequest, - TokenResponse, RefreshRequest, + RegisterRequest, + TokenResponse, ) +from dwf.services.auth_service import AuthService from dwf.settings import Settings router = APIRouter(prefix="/auth", tags=["auth"]) diff --git a/backend/dwf/infrastructure/database/models/__init__.py b/backend/dwf/infrastructure/database/models/__init__.py index 8c4bc83c..09d550a9 100644 --- a/backend/dwf/infrastructure/database/models/__init__.py +++ b/backend/dwf/infrastructure/database/models/__init__.py @@ -1,4 +1,4 @@ -from .Base import Base +from .base import Base from .user import User from .workflow import Workflow diff --git a/backend/dwf/infrastructure/database/models/Base.py b/backend/dwf/infrastructure/database/models/base.py similarity index 100% rename from backend/dwf/infrastructure/database/models/Base.py rename to backend/dwf/infrastructure/database/models/base.py diff --git a/backend/dwf/infrastructure/database/models/user.py b/backend/dwf/infrastructure/database/models/user.py index 3b19ed85..4ead3502 100644 --- a/backend/dwf/infrastructure/database/models/user.py +++ b/backend/dwf/infrastructure/database/models/user.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy.sql import func -from .Base import Base +from .base import Base class User(Base): diff --git a/backend/dwf/infrastructure/database/models/workflow.py b/backend/dwf/infrastructure/database/models/workflow.py index a484caf2..4388eda3 100644 --- a/backend/dwf/infrastructure/database/models/workflow.py +++ b/backend/dwf/infrastructure/database/models/workflow.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import Mapped, mapped_column from sqlalchemy.sql import func -from .Base import Base +from .base import Base class Workflow(Base): diff --git a/backend/dwf/main.py b/backend/dwf/main.py index 7e47ad80..1ef5ce5a 100644 --- a/backend/dwf/main.py +++ b/backend/dwf/main.py @@ -37,8 +37,8 @@ def create_app(settings: Settings | None = None) -> FastAPI: ) app.state.settings = settings - from dwf.api.routers.health import router as health_router from dwf.api.routers.auth import router as auth_router + from dwf.api.routers.health import router as health_router from dwf.api.routers.workflows import router as workflows_router app.include_router(health_router) diff --git a/backend/dwf/settings.py b/backend/dwf/settings.py index 5d271f27..97a49303 100644 --- a/backend/dwf/settings.py +++ b/backend/dwf/settings.py @@ -13,6 +13,3 @@ class Settings(BaseSettings): env_file_encoding="utf-8", case_sensitive=False, ) - - -settings = Settings() diff --git a/backend/requirements.txt b/backend/requirements.txt index b8b3510b..bac7f768 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,58 +1,94 @@ +aiosqlite==0.22.1 alembic==1.19.1 amqp==5.3.1 annotated-doc==0.0.5 annotated-types==0.8.0 anyio==4.14.2 +argon2-cffi==25.1.0 +argon2-cffi-bindings==26.1.0 +ast_serialize==0.11.0 +asyncpg==0.31.0 bcrypt==5.0.0 billiard==4.2.4 celery==5.6.3 certifi==2026.7.22 +cffi==2.1.1 +cfgv==3.5.0 +charset-normalizer==3.5.1 click==8.4.2 click-didyoumean==0.3.1 click-plugins==1.1.1.2 click-repl==0.3.0 +cryptography==50.0.1 +distlib==0.4.3 distro==1.9.0 dnspython==2.8.0 ecdsa==0.19.2 email-validator==2.3.0 fastapi==0.141.1 -greenlet==3.5.5 +filelock==3.32.5 +google-auth==2.57.1 google-genai==1.52.0 +greenlet==3.5.5 h11==0.16.0 httpcore==1.0.9 +httptools==0.8.0 httpx==0.28.1 +identify==2.6.19 idna==3.18 iniconfig==2.3.0 jiter==0.16.0 kombu==5.6.2 +librt==0.15.0 Mako==1.4.1 MarkupSafe==3.0.3 +mypy==2.3.1 +mypy_extensions==1.1.0 +nodeenv==1.10.0 openai==2.53.0 packaging==26.3 passlib==1.7.4 +pathspec==1.1.1 +platformdirs==4.11.7 pluggy==1.6.0 +pre_commit==4.6.2 prompt_toolkit==3.0.53 psycopg2-binary==2.9.12 pyasn1==0.6.4 +pyasn1_modules==0.4.2 +pycparser==3.0 pydantic==2.13.4 pydantic-settings==2.15.0 pydantic_core==2.46.4 Pygments==2.20.0 +PyJWT==2.14.0 pytest==9.1.1 +pytest-asyncio==1.4.0 python-dateutil==2.9.0.post0 +python-discovery==1.6.0 python-dotenv==1.2.2 python-jose==3.5.0 +PyYAML==6.0.3 redis==8.1.0 +requests==2.34.2 rsa==4.9.1 +ruff==0.16.6 six==1.17.0 sniffio==1.3.1 SQLAlchemy==2.0.51 starlette==1.6.0 +structlog==26.1.0 +tenacity==9.1.4 tqdm==4.70.0 typing-inspection==0.4.3 typing_extensions==4.16.0 tzdata==2026.3 tzlocal==5.4.4 +urllib3==2.7.0 uvicorn==0.52.1 +uvloop==0.22.1 vine==5.1.0 +virtualenv==21.7.8 +watchfiles==1.2.0 wcwidth==0.8.2 +websockets==15.0.1 diff --git a/backend/test.db b/backend/test.db index 8bb9c17d..129598f4 100644 Binary files a/backend/test.db and b/backend/test.db differ diff --git a/backend/tests/conftest.py b/backend/tests/conftest.py index 526c564d..8c31c8ef 100644 --- a/backend/tests/conftest.py +++ b/backend/tests/conftest.py @@ -2,9 +2,9 @@ from httpx import ASGITransport, AsyncClient from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker, create_async_engine +from dwf.api.deps import get_db from dwf.infrastructure.database.models import Base from dwf.main import create_app -from dwf.api.deps import get_db from dwf.settings import Settings TEST_DATABASE_URL = "sqlite+aiosqlite:///test.db"