[moz] infra: CI runner Python 3.9 导致 pydantic 安装间歇性失败 #98
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题描述
CI test job 间歇性失败。pip install pydantic 在 Python 3.9.6 上无法找到兼容版本(新版 pydantic 需要 >=3.10)。同样的代码有时成功有时失败(run 430 成功,run 429/431 失败),属于 flaky。
错误来源
日志关键片段
判断依据
建议修复方向
pydantic<2(临时方案)修复方案
根因:CI runner 使用系统 Python 3.9.6,
pip install pydantic(无版本约束)间歇性无法找到兼容版本。pydantic 2.x 需要 Python >=3.10。修复:在 CI workflow 中 pin
pydantic<2。项目仅使用
pydantic.BaseModel(checkpoint_routes.py),1.x 和 2.x 均兼容,pin <2 安全。PR:#99
CI 状态:正在运行中,等待验证。CI 通过后 merge PR #99 即关闭本 Issue。
后续(长期方案):升级 CI runner Python 到 3.12+,届时可去掉版本约束。
✅ CI 验证通过。
修复有效,pydantic pin <2 解决了 Python 3.9 兼容问题。PR #99 可 merge。