Repository navigation
ci: Python 3.9 钉 ubuntu-24.04(26.04 无 3.9 构建) - #49
Conversation
ubuntu-latest 已升 26.04,而 actions/python-versions 最新 3.9.25 只构建到 24.04(3.9 于 2025-10 EOL),setup-python 直接报 version not found,两个 job 在装解释器阶段即失败,从未跑到测试。 test 矩阵的 3.9 与 oldest-deps 均钉 ubuntu-24.04,其余 Python 版本仍走 ubuntu-latest;下界提升到 >=3.10 时整块删除。 失败 run: 41432215926 / 41392461949 / 41272108184(issue #48)
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
审阅者指南(小型 PR 默认折叠)审阅者指南调整 GitHub Actions 的运行器矩阵:Python 3.9 使用仍有可用构建的 Ubuntu 24.04,避免 ubuntu-latest(Ubuntu 26.04)在 setup-python 阶段失败;Python 3.10–3.14 及其他平台保持原有配置。 Python 3.9 CI 运行器选择流程图flowchart TD
Matrix[CI Python and OS matrix] --> Legacy{Python 3.9}
Matrix --> Current{Python 3.10 to 3.14}
Legacy --> Ubuntu24[ubuntu-24.04]
Legacy --> MacOS[macos-latest]
Current --> UbuntuLatest[ubuntu-latest]
Ubuntu24 --> SetupPython["actions/setup-python@v5"]
UbuntuLatest --> SetupPython
MacOS --> SetupPython
文件级变更
可能关联的问题
提示和命令与 Sourcery 交互
自定义使用体验访问你的控制面板以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's Guide调整 GitHub Actions 的运行器矩阵:Python 3.9 使用仍有可用构建的 Ubuntu 24.04,避免 ubuntu-latest(Ubuntu 26.04)在 setup-python 阶段失败;Python 3.10–3.14 及其他平台保持原有配置。 Flow diagram for Python 3.9 CI runner selectionflowchart TD
Matrix[CI Python and OS matrix] --> Legacy{Python 3.9}
Matrix --> Current{Python 3.10 to 3.14}
Legacy --> Ubuntu24[ubuntu-24.04]
Legacy --> MacOS[macos-latest]
Current --> UbuntuLatest[ubuntu-latest]
Ubuntu24 --> SetupPython["actions/setup-python@v5"]
UbuntuLatest --> SetupPython
MacOS --> SetupPython
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
根因
issue #48 的三个失败 run(41272108184 / 41392461949 / 41432215926)两次失败 job 完全相同:
test (ubuntu-latest, 3.9)与oldest-deps。日志显示两者都死在
actions/setup-python@v5:ubuntu-latest 已切到 26.04;
actions/python-versions最新构建 3.9.25 的平台清单只有linux 22.04/linux 24.04/darwin,没有 26.04(3.9 于 2025-10 EOL)。因此不是代码问题,是从未跑到测试阶段。修复
test矩阵:3.9 用include加ubuntu-24.04,exclude掉ubuntu-latest的 3.9;其余 3.10–3.14 不变,仍走 ubuntu-latest(26.04 有构建)。oldest-deps:runs-on改ubuntu-24.04(它固定 3.9)。两处都留了注释说明触发条件与删除时机(下界升到 ≥3.10 时整块移除)。
验证
actionlint .github/workflows/ci.yml通过。ubuntu-24.04与macos-latest,其余在ubuntu-latest。137 passed,--cov-fail-under=98通过 → 代码本身在 3.9 无问题,失败纯属 runner 镜像。Refs #48
Sourcery 总结
通过将 Python 3.9 的 CI 任务改为使用 Ubuntu 24.04,而非与其不兼容的
ubuntu-latest运行器,保留 Python 3.9 的 CI 覆盖。错误修复:
ubuntu-latest升级至 Ubuntu 26.04 后,继续保持 Python 3.9 的 CI 覆盖正常运行;Ubuntu 26.04 上无法使用兼容的 Python 3.9 构建版本。改进:
ubuntu-latest。CI:
Original summary in English
Summary by Sourcery
Preserve Python 3.9 CI coverage by routing its jobs to Ubuntu 24.04 instead of the incompatible ubuntu-latest runner.
Bug Fixes:
Enhancements:
CI: