[moz] ci(deploy): deploy.yml ci job 同步 #134 修复——钉解释器+锁 pydantic<2+flake8
#134 合入 main 后 deploy 管道 ci job 失败(c222694,task 2262),三重问题: - 裸 python3 → runner PATH 解析 3.14.6,tokenize 漂移致 E122 假阳性(同 ci.yml 已修根因) - pydantic 未锁:装到 v2,代码库是 v1 基线 → import 崩(ci.yml test 一直锁 pydantic<2) - flake8 未锁 修复镜像 ci.yml 已验证配方:/usr/bin/python3 venv + flake8==7.3.0 + pydantic<2 + PYTHONPATH 对齐。本地同配方已验证(lint 零报错两轮 + 503 passed/9 skipped)。 交付检查:docs/design 无需更新(环境策略写入 workflow 注释,同 #134 结论);tests 无需更新(命令集=ci.yml 已绿配方)。 注:jiangwei PAT API 401 未恢复,无法建 PR,请 reviewer 代建+review+merge。
This commit is contained in:
@@ -33,9 +33,9 @@ jobs:
|
||||
no_proxy: "*"
|
||||
run: |
|
||||
rm -rf /tmp/ci-venv-deploy
|
||||
python3 -m venv /tmp/ci-venv-deploy
|
||||
/usr/bin/python3 -m venv /tmp/ci-venv-deploy # 钉解释器 3.9.6:同 ci.yml 修复(#134),brew python3=3.14 的 tokenize 漂移致 E122 假阳性
|
||||
/tmp/ci-venv-deploy/bin/pip install --quiet --upgrade pip
|
||||
/tmp/ci-venv-deploy/bin/pip install --quiet flake8 fastapi pydantic pyyaml uvicorn requests pytest pytest-asyncio httpx
|
||||
/tmp/ci-venv-deploy/bin/pip install --quiet 'flake8==7.3.0' fastapi 'pydantic<2' pyyaml uvicorn requests pytest pytest-asyncio httpx # 锁版本:pydantic<2(代码库 v1 基线,未锁会装 v2 import 崩)+ flake8 防漂移
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
|
||||
- name: Unit & Integration Tests
|
||||
run: |
|
||||
/tmp/ci-venv-deploy/bin/pytest tests/ -m "not e2e" -x -q
|
||||
PYTHONPATH=$(pwd) /tmp/ci-venv-deploy/bin/pytest tests/ -m "not e2e" -x -q # 对齐 ci.yml test 配方
|
||||
|
||||
# ── Job 2: 部署 ─────────────────────────────────────
|
||||
deploy:
|
||||
|
||||
Reference in New Issue
Block a user