chore(V2): cleanup quality gate

- ruff: contextlib.suppress al posto di try/except/pass (client_registry, test_env_routing)
- rimozione services/ legacy (residuo da git rm)
- fix integration test fixture: rimosso sys.modules.pop che inquinava module references nei test successivi (test_audit, test_client_init_default_http)

254 test passano. Ruff: clean. Mypy: 68 warning preesistenti dal codice V1 migrato (strict=false).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
AdrianoDev
2026-04-30 19:02:55 +02:00
parent b552127479
commit b71c66917c
13 changed files with 35 additions and 34 deletions
+6 -1
View File
@@ -18,7 +18,12 @@ from cerbero_mcp.client_registry import ClientRegistry
from cerbero_mcp.common.logging import configure_root_logging
from cerbero_mcp.exchanges import build_client
from cerbero_mcp.routers import (
alpaca, bybit, deribit, hyperliquid, macro, sentiment,
alpaca,
bybit,
deribit,
hyperliquid,
macro,
sentiment,
)
from cerbero_mcp.server import build_app
from cerbero_mcp.settings import Settings
+2 -3
View File
@@ -2,6 +2,7 @@
from __future__ import annotations
import asyncio
import contextlib
from collections import defaultdict
from collections.abc import Awaitable, Callable
from typing import Any, Literal
@@ -34,8 +35,6 @@ class ClientRegistry:
close = getattr(client, "aclose", None)
if close is None:
continue
try:
with contextlib.suppress(Exception):
await close()
except Exception:
pass
self._clients.clear()
+2 -1
View File
@@ -3,9 +3,10 @@ from __future__ import annotations
import asyncio
from typing import Any
from pybit.unified_trading import HTTP
from cerbero_mcp.common import indicators as ind
from cerbero_mcp.common import microstructure as micro
from pybit.unified_trading import HTTP
def _f(v: Any) -> float | None:
+7 -2
View File
@@ -4,9 +4,14 @@ from datetime import UTC, datetime, timedelta
from typing import Any
import httpx
from cerbero_mcp.common.http import async_client
from cerbero_mcp.exchanges.macro.cot import classify_extreme, compute_percentile, parse_disagg_row, parse_tff_row
from cerbero_mcp.common.http import async_client
from cerbero_mcp.exchanges.macro.cot import (
classify_extreme,
compute_percentile,
parse_disagg_row,
parse_tff_row,
)
from cerbero_mcp.exchanges.macro.cot_contracts import (
ALL_DISAGG_SYMBOLS,
ALL_TFF_SYMBOLS,