chore(V2): mypy clean — fix radice V2 nuovo + suppress mirato V1 legacy
- settings.py: lambda factory + type:ignore[call-arg] per env-loaded models
- routers/*.py (6 file): cast esplicito Environment / Client per request.state
- __main__.py: cast Literal env in builder, type:ignore Settings()
- server.py: type:ignore[method-assign] su app.openapi
- deribit/tools.py: assert su validator-normalized fields, list return type
- deribit/client.py: type:ignore mirato no-any-return / has-type, rinomina types→types_list
- hyperliquid/{client,tools}.py: assert su validator-normalized fields, var-annotated
- alpaca/client.py: type:ignore mirato per SDK quirks (assignment, no-any-return, arg-type, union-attr)
- {macro,sentiment}/fetchers.py: type:ignore mirato no-any-return / operator / union-attr
Mypy: 68 → 0 errors. Test: 259 passing. Ruff: clean.
This commit is contained in:
@@ -296,10 +296,12 @@ async def environment_info(
|
||||
|
||||
|
||||
async def get_ticker(client: DeribitClient, params: GetTickerReq) -> dict:
|
||||
assert params.instrument_name is not None # validator garantisce non-None
|
||||
return await client.get_ticker(params.instrument_name)
|
||||
|
||||
|
||||
async def get_ticker_batch(client: DeribitClient, params: GetTickerBatchReq) -> dict:
|
||||
assert params.instrument_names is not None # validator garantisce non-None
|
||||
return await client.get_ticker_batch(params.instrument_names)
|
||||
|
||||
|
||||
@@ -327,7 +329,7 @@ async def get_orderbook_imbalance(
|
||||
return await client.get_orderbook_imbalance(params.instrument_name, params.depth)
|
||||
|
||||
|
||||
async def get_positions(client: DeribitClient, params: GetPositionsReq) -> dict:
|
||||
async def get_positions(client: DeribitClient, params: GetPositionsReq) -> list:
|
||||
return await client.get_positions(params.currency)
|
||||
|
||||
|
||||
@@ -337,7 +339,7 @@ async def get_account_summary(
|
||||
return await client.get_account_summary(params.currency)
|
||||
|
||||
|
||||
async def get_trade_history(client: DeribitClient, params: GetTradeHistoryReq) -> dict:
|
||||
async def get_trade_history(client: DeribitClient, params: GetTradeHistoryReq) -> list:
|
||||
return await client.get_trade_history(params.limit, params.instrument_name)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user