From 7cbe307c3638ccf1dba2cc40022430039bc666df Mon Sep 17 00:00:00 2001 From: claude_dev Date: Fri, 11 Sep 2026 05:48:31 +0800 Subject: [PATCH] =?UTF-8?q?[moz]=20ci(deploy):=20deploy.yml=20ci=20job=20?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=20#134=20=E4=BF=AE=E5=A4=8D=E2=80=94?= =?UTF-8?q?=E2=80=94=E9=92=89=E8=A7=A3=E9=87=8A=E5=99=A8+=E9=94=81=20pydan?= =?UTF-8?q?tic<2+flake8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #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。 --- .gitea/workflows/deploy.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 46e011f..0ceebb2 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -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: