4d9db750be
- pyproject.toml: ruff target-version py311 → py313 (auto-fix 42 lint warnings via UP rules); aggiunto consider_namespace_packages = true che risolve la collisione conftest tra servizi e permette di lanciare pytest sull'intera suite cross-servizio. - mcp_common.audit: nuovo helper audit_write_op() con logger dedicato mcp.audit. Wirato su tutti i write endpoint di deribit, bybit, alpaca e hyperliquid (place_order, place_combo_order, cancel_*, set_*, close_*, transfer_*, switch_*, amend_*) con principal + target + payload non-sensibile + result summarizzato. - mcp_common.app_factory: ExchangeAppSpec + run_exchange_main() centralizza il boilerplate dei __main__.py (configure_root_logging, fail_fast_if_missing, summarize, load creds, resolve_environment, load token store, uvicorn). I 4 __main__.py exchange ridotti da ~60 LOC ognuno a ~25 LOC dichiarativi. mcp_common.env_validation promosso da mcp_deribit (mantenuto re-export shim per back-compat test_env_validation). - 8 test nuovi (4 audit + 4 app_factory). Suite full: 450/450 verdi. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
48 lines
935 B
TOML
48 lines
935 B
TOML
[tool.uv.workspace]
|
|
members = [
|
|
"services/common",
|
|
"services/mcp-alpaca",
|
|
"services/mcp-bybit",
|
|
"services/mcp-deribit",
|
|
"services/mcp-hyperliquid",
|
|
"services/mcp-macro",
|
|
"services/mcp-sentiment",
|
|
]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py313"
|
|
|
|
[tool.ruff.lint]
|
|
select = ["E", "F", "I", "W", "UP", "B", "SIM"]
|
|
ignore = ["E501"]
|
|
|
|
[tool.ruff.lint.flake8-bugbear]
|
|
extend-immutable-calls = [
|
|
"fastapi.Depends",
|
|
"fastapi.Query",
|
|
"fastapi.Body",
|
|
"fastapi.Header",
|
|
"fastapi.Path",
|
|
"fastapi.Cookie",
|
|
"fastapi.Form",
|
|
"fastapi.File",
|
|
"fastapi.Security",
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"**/test_*.py" = ["B008"]
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["services"]
|
|
addopts = "--import-mode=importlib"
|
|
consider_namespace_packages = true
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest>=9.0.3",
|
|
"pytest-asyncio>=1.3.0",
|
|
"pytest-httpx>=0.36.2",
|
|
]
|