ci: 修复 main 上 Python CI 历史失败(在 python3.12+node 容器内运行) #28
Reference in New Issue
Block a user
Delete Branch "devin/1782280936-fix-python-ci"
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?
背景
Python (ingestion)job 在 main 上一直失败。根因:自建 Gitea Runner 上setup-python@v5无法下载 CPython 3.12(它会向 Gitea API 查询actions/python-versions仓库,返回 404),于是静默回退到镜像自带的系统 Python 3.10 + pip 22.0.2。旧 pip 不支持 PEP 660 可编辑安装,pip install -e报build backend is missing the build_editable hook;且 3.10 低于项目要求的requires-python>=3.11(代码用了datetime.UTC)。改动
将该 job 放进
nikolaik/python-nodejs:python3.12-nodejs20容器运行,镜像自带 Python 3.12 + Node 20(供 actions/checkout)+ 现代 pip,彻底去掉对 GitHub 下载的依赖,并移除setup-python步骤。验证
在服务器同款容器内用真实源码跑过:install / ruff check / ruff format --check 全过,pytest 36 passed, 6 skipped。