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 -4
View File
@@ -681,9 +681,7 @@ class TestStrengthRankerInit:
from easy_tdx.screen.strength import StrengthRanker
with patch("easy_tdx.screen.strength.resolve_vipdoc", return_value=Path("/fake")):
ranker = StrengthRanker(
preset="steady", w5=0.5, w20=0.3, w60=0.2, vol_adjusted=False
)
ranker = StrengthRanker(preset="steady", w5=0.5, w20=0.3, w60=0.2, vol_adjusted=False)
assert ranker._w5 == 0.5
assert ranker._w20 == 0.3
assert ranker._w60 == 0.2
@@ -695,4 +693,3 @@ class TestStrengthRankerInit:
with patch("easy_tdx.screen.strength.resolve_vipdoc", return_value=Path("/fake")):
ranker = StrengthRanker(preset="breakout")
assert ranker.preset == "breakout"