fix(ci): mypy python_version 3.10 → 3.12 修复 numpy stub 语法错误

根因:CI 的 mypy job 在 Python 3.13 下运行,安装的 numpy 2.x stub
使用 PEP 695 type 语句(3.12+ 语法),但 pyproject.toml 的
python_version="3.10" 让 mypy 按 3.10 语义解析,报
'Type statement is only supported in Python 3.12 and greater'。

修复:
- python_version 提升到 3.12(CI mypy job 实际跑 3.13,开发目标版本对齐)
- mypy/ruff 同步排除 gitignored 的 exchange_margin.py 本地脚本
- 顺带修复 market.py / test_screen.py 的 ruff format 漂移
This commit is contained in:
Justin Gu
2026-06-25 03:46:57 +08:00
parent e5bc1b1a16
commit 77104a32e3
3 changed files with 6 additions and 9 deletions
+1 -3
View File
@@ -145,9 +145,7 @@ async def market_strength(
# 注:在协程内用 get_running_loop() 而非 get_event_loop()
# 后者在 Python 3.12+ 已弃用。
loop = asyncio.get_running_loop()
results = await loop.run_in_executor(
None, lambda: ranker.rank(universe=universe, top_n=top_n)
)
results = await loop.run_in_executor(None, lambda: ranker.rank(universe=universe, top_n=top_n))
records = [
{