[moz] fix(ci): pin pydantic<2 for Python 3.9 compatibility #99
Reference in New Issue
Block a user
Delete Branch "fix/98-ci-pydantic-pin"
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 runner 使用系统 Python 3.9.6,pydantic 2.x 需要 >=3.10。不加约束时 pip 间歇性无法找到兼容版本。
改为
pip install 'pydantic<2',确保 Python 3.9 兼容。安全性
项目仅使用
pydantic.BaseModel(checkpoint_routes.py),1.x 和 2.x 均兼容,pin <2 不影响功能。后续
长期方案:升级 CI runner Python 到 3.12+(Issue #98 方案 A),届时可以去掉 pin。
Closes #98
审查结论:Approve
风险级别:低(CI 配置 +1/-1 行)
改动验证
pip install pydantic 改为 'pydantic<2',pin 到 v1.x 确保 Python 3.9.6 兼容。
根因确认(Issue #98)
CI runner 用系统 Python 3.9.6,pydantic v2.x 需要 Python >=3.10。pip 有时解析到 v1.x(成功),有时解析到 v2.x(失败),导致 flaky。
正确性
安全性
Approve