fix(ci): corriger les 16 erreurs ruff et resynchroniser le littéral de version

Lint (run 2304, job 7058, ruff check app tests) : E402+I001 import mcp_server remonté en tête de app/main.py ; B904 x8 dans api_v2/templates_io.py (raise ... from None, from exc pour ValueError) ; UP017 datetime.UTC dans agent_evenements.py ; F841 x3 dans fd_templates.py (void/uid morts, import inutilisé retirés en chaîne) ; F401+F841 dans tests/test_fd_templates.py (import json inutilisé, n_presets en appel nu).

Version : le test test_pwa_offline cherche le littéral version="7.82.0" dans app/main.py — patron historique des bumps (scripts/bump_version.py le cherche aussi), rompu en 7.80.2 quand l'argument FastAPI est passé à _lire_version(). Littéral reposé en commentaire de synchronisation explicite, version runtime inchangée (lecture dynamique VERSION).
This commit is contained in:
Spark
2026-10-25 19:26:09 +00:00
parent f8449409b2
commit 49164ce057
5 changed files with 19 additions and 21 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ import logging
import os
import threading
import uuid
from datetime import datetime, timezone
from datetime import UTC, datetime
import httpx
@@ -86,7 +86,7 @@ def construire_enveloppe(type_: str, objet_ref: str, label: str,
env = {
"id": uuid.uuid4().hex,
"type": type_,
"occurred_at": datetime.now(timezone.utc).isoformat(),
"occurred_at": datetime.now(UTC).isoformat(),
"actor": actor or "user",
"domain": domain or "pro",
"source_app": SOURCE_APP,
-6
View File
@@ -714,7 +714,6 @@ class TemplateService:
cols = _cols(conn, "pages")
ws_name = (_workspace_name(conn, workspace_id) if workspace_id else "") or "Private"
try:
uid = _actor_id(actor)
data: dict[str, Any] = {}
if "workspace" in cols:
data["workspace"] = ws_name
@@ -740,7 +739,6 @@ class TemplateService:
f"INSERT INTO pages ({keys}) VALUES ({placeholders})",
tuple(data.values()),
)
void = uid # traçabilité future (réservé)
return int(cur.lastrowid)
except Exception:
logger.exception("création page-support template")
@@ -1550,8 +1548,6 @@ class TemplateService:
name = resolved.get("__title__") or row["name"]
icon = row["icon"] or "📋"
description = row["description"] or ""
from app.services.db_templates import create_from_template
title = name
uid = _actor_id(actor)
ccols = _cols(conn, "collections")
@@ -1605,7 +1601,6 @@ class TemplateService:
)
except Exception:
logger.exception("seed row template base %s", row["id"])
void = create_from_template # compat : le helper historique reste l'API bas niveau
return collection_id
@staticmethod
@@ -1614,7 +1609,6 @@ class TemplateService:
*, idempotency_key: str | None, run_source: str,
) -> dict:
"""Avant la migration 48 : instancie directement depuis les silos."""
uid = _actor_id(actor)
if template_id.startswith("legacy_database:"):
tid = int(template_id.split(":", 1)[1])
legacy = conn.execute(