- Fix 71 invalid-syntax files (class-body newline-broken assignments) - Add from/None chain to 307 B904 raise-without-from sites - Add B008 ignore to ruff.toml (already in pyproject.toml) - Noqa F401 on __init__.py re-exports (137 sites) - Noqa E402 on deferred imports (63 sites) - Bulk-add stdlib/FastAPI/project imports for F821 (127 sites) - Replace ×→x, –→-, …→... in docstrings (4093 chars) - Manual refactor of 5 SIM103/SIM116 patterns Tests: 791 passed (66 deselected due to pre-existing Redis issues in test_rag.py) Co-authored-by: opencode <opencode@rugmunch.io>
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
"""Shared FastAPI dependencies.
|
|
|
|
Use these in route signatures to inject cross-cutting concerns:
|
|
from app.api.deps import get_redis, get_current_user, get_settings
|
|
|
|
Actual implementations live in `app/core/`. This module is a re-export
|
|
facade so route authors don't need to know which core module owns what.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
# Re-exports - actual implementations come from app/core/.
|
|
# Core modules are populated by the parallel DeepSeek tasks (DS-1..DS-10).
|
|
# Until then, these imports will fail; routes should not depend on them yet.
|
|
try:
|
|
from app.core.redis import get_redis
|
|
except ImportError:
|
|
get_redis = None # type: ignore[assignment]
|
|
|
|
try:
|
|
from app.core.db import get_db
|
|
except ImportError:
|
|
get_db = None # type: ignore[assignment]
|
|
|
|
try:
|
|
from app.core.auth import get_current_user, get_optional_user
|
|
except ImportError:
|
|
get_current_user = None # type: ignore[assignment]
|
|
get_optional_user = None # type: ignore[assignment]
|
|
|
|
try: # noqa: SIM105
|
|
from app.core.config import settings # noqa: F401
|
|
except ImportError:
|
|
pass # fallback until core.config lands
|