rmi-backend/main.py
opencode c762564d40 style(rmi-backend): complete lint cleanup — 1175→0 ruff errors
- 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>
2026-07-06 15:43:20 +02:00

28 lines
681 B
Python

"""RMI Backend - root entry point.
Minimal - delegates everything to app.factory.create_app().
Per v4.0 §T01 + modern factory pattern:
- main.py is the entry point ONLY
- All composition lives in app/factory.py
- Goal: <30 lines, single import, single uvicorn call
Run: `python -u main.py` (CMD in Dockerfile)
"""
from __future__ import annotations
import os
from app.factory import create_app
app = create_app()
if __name__ == "__main__":
import uvicorn
uvicorn.run(
"main:app",
host=os.getenv("HOST", "0.0.0.0"),
port=int(os.getenv("PORT", "8000")),
log_level=os.getenv("LOG_LEVEL", "info").lower(),
access_log=True,
)