Compare commits

...

3 Commits

Author SHA1 Message Date
pangtong-fujunshi c22269497a Merge PR #134: [moz] fix(ci) venv 钉死 3.9.6 修复 E122 假阳性
Deploy / ci (push) Failing after 2m14s
Deploy / deploy (push) Has been skipped
Deploy / notify-deploy-failure (push) Successful in 6s
Deploy / notify-deploy-success (push) Successful in 4s
2026-09-10 21:39:32 +00:00
claude_dev 96d6926272 [moz] ci: venv 解释器钉 /usr/bin/python3(3.9.6)——真因是 3.14 tokenize 行为变化
CI / lint (pull_request) Successful in 19s
CI / test (pull_request) Successful in 27s
CI / frontend (pull_request) Successful in 27s
CI / notify-on-failure (pull_request) Successful in 1s
修正 19a76e2 的错误归因:flake8/pycodestyle 版本无漂移(CI venv 与
本地用户站完全同版 7.3.0/2.14.0,已对拍排除)。真正差异是解释器:
- runner PATH 首位 /opt/homebrew/bin(7-5 起 python3→3.14.6)
- Python 3.12+ 重写 tokenize,pycodestyle E122 判定翻转
- 同一 toolchain_routes.py:1217:3.9 零报错 / 3.14 报 E122(实证)
- 6-25 绿色基线的 CI venv 是 python3.9(6月任务日志实证)
- 另:pydantic<2 无 3.14 wheel,test job 在 3.14 下必挂

本地预验证(/usr/bin/python3 3.9.6,CI 同款命令):
- lint: flake8 7.3.0 全量 src/ exit=0 零报错(两轮)
- test: 同款依赖 503 passed / 9 skipped / 0 failed

交付检查:docs/design 无需更新(环境策略写入 ci.yml 注释);tests
无需更新(本提交含全量预验证)。
2026-09-11 05:32:14 +08:00
claude_dev 19a76e25d6 [moz] ci(lint): 锁定 flake8==7.3.0,修复版本漂移致 E122 全线误报
CI / lint (pull_request) Failing after 18s
CI / test (pull_request) Has been skipped
CI / frontend (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Successful in 10s
根因:ci.yml lint 步骤 pip install flake8 未锁版本,runner 每次装最新版。
2026-09-11 新版 pycodestyle 对 main 现存代码(toolchain_routes.py:1217)报
E122,而该代码 2026-06-23 后未改动、06-25 CI 绿——纯工具版本漂移,main
全量 lint 现已必红,阻塞所有 PR(含挂起 9 天的 #131)。

证据:本地 flake8 7.3.0 (pycodestyle 2.14.0) 对 origin/main 全量 src/
零报错(exit=0);CI 同款命令最新版报 1217:21 E122。

处置:锁定 7.3.0(实证绿版本),版本策略写入 ci.yml 行内注释。
纯 CI 配置变更,不碰业务代码。

交付检查:
- docs/design:无需更新(设计文档未规定 flake8 版本策略,ci.yml 注释即现行说明)
- tests:无需更新(纯 CI 配置,本 PR 自身 CI 即验证)
2026-09-11 05:19:29 +08:00
+3 -3
View File
@@ -32,9 +32,9 @@ jobs:
no_proxy: "*"
run: |
rm -rf /tmp/ci-venv-lint
python3 -m venv /tmp/ci-venv-lint
/usr/bin/python3 -m venv /tmp/ci-venv-lint # 钉解释器:runner PATH 首位 homebrew python3=3.14(tokenize 行为变化致 E122 误报);3.9.6=6月绿基线
/tmp/ci-venv-lint/bin/pip install --quiet --upgrade pip
/tmp/ci-venv-lint/bin/pip install --quiet flake8
/tmp/ci-venv-lint/bin/pip install --quiet 'flake8==7.3.0' # 锁版本(防漂移)。注:首版归因 pycodestyle 有误,真因是解释器 3.14 tokenize 变化,见本 PR 后续 commit
- name: Lint with flake8
run: |
@@ -52,7 +52,7 @@ jobs:
no_proxy: "*"
run: |
rm -rf /tmp/ci-venv-test
python3 -m venv /tmp/ci-venv-test
/usr/bin/python3 -m venv /tmp/ci-venv-test # 同钉 3.9.6:pydantic<2 无 3.14 wheel;全量 503 用例本地实证绿
/tmp/ci-venv-test/bin/pip install --quiet --upgrade pip
/tmp/ci-venv-test/bin/pip install --quiet 'fastapi' 'pydantic<2' pyyaml uvicorn requests pytest pytest-asyncio httpx