ci: 修复 main 上 Python CI 历史失败(在 python3.12+node 容器内运行) #28

Merged
lixu merged 5 commits from devin/1782280936-fix-python-ci into main 2026-06-24 14:32:51 +08:00
Owner

背景

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 -ebuild 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。

## 背景 `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。
lixu added 1 commit 2026-06-24 14:02:44 +08:00
ci: run Python job in python3.12+node container
CI / Go (api) (pull_request) Failing after 1m32s
CI / Python (ingestion) (pull_request) Failing after 31s
CI / Migrations (postgres) (pull_request) Failing after 19m16s
3364a50c68
setup-python@v5 can't fetch CPython 3.12 on the self-hosted Gitea runner
(it queries the Gitea API for actions/python-versions, which 404s), so the
job silently fell back to the image's system Python 3.10 + pip 22.0.2. That
old pip lacks PEP 660 editable support, so 'pip install -e' failed with
'build backend is missing the build_editable hook', and 3.10 is below the
project's requires-python>=3.11 (code uses datetime.UTC).

Run the job inside nikolaik/python-nodejs:python3.12-nodejs20 which bundles
Python 3.12, Node 20 (for actions/checkout) and modern pip, removing the
GitHub download dependency entirely.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
lixu added 1 commit 2026-06-24 14:10:25 +08:00
ci: re-trigger after configuring action proxy
CI / Go (api) (pull_request) Failing after 13s
CI / Python (ingestion) (pull_request) Failing after 31s
CI / Migrations (postgres) (pull_request) Failing after 1m32s
2aff6287d2
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
lixu added 1 commit 2026-06-24 14:21:05 +08:00
ci: re-trigger with self-hosted actions
CI / Go (api) (pull_request) Failing after 12s
CI / Python (ingestion) (pull_request) Failing after 1m31s
CI / Migrations (postgres) (pull_request) Failing after 32s
885f6c2b01
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
lixu added 1 commit 2026-06-24 14:24:55 +08:00
ci: re-trigger with public gitea actions url
CI / Go (api) (pull_request) Failing after 11s
CI / Python (ingestion) (pull_request) Failing after 31s
CI / Migrations (postgres) (pull_request) Failing after 11s
5020fdcc19
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
lixu added 1 commit 2026-06-24 14:30:07 +08:00
ci: remove GitHub-hosted actions, manual checkout + Go from CN mirror
CI / Go (api) (pull_request) Successful in 51s
CI / Python (ingestion) (pull_request) Successful in 21s
CI / Migrations (postgres) (pull_request) Successful in 26s
17bc0ed680
Self-hosted Gitea runner has flaky/blocked access to github.com, causing
actions/checkout and actions/setup-go to time out intermittently across all
jobs. Replace them with:
- manual git checkout against $GITHUB_SERVER_URL (the Gitea host, reachable
  from job containers)
- Go installed from mirrors.aliyun.com

Python job stays on the python3.12-nodejs20 container (fixes the original
PEP 660 editable-install failure). No more github.com network dependency.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
lixu merged commit 20b9eb0fc9 into main 2026-06-24 14:32:51 +08:00
lixu deleted branch devin/1782280936-fix-python-ci 2026-06-24 14:32:51 +08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lixu/goods#28