Skip to content

ci: Python 3.9 钉 ubuntu-24.04(26.04 无 3.9 构建) - #49

Merged
im47cn merged 1 commit into
mainfrom
fix/ci-py39-ubuntu-24
Nov 3, 2026
Merged

im47cn merged 1 commit into
mainfrom
fix/ci-py39-ubuntu-24

Conversation

@im47cn

@im47cn im47cn commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

根因

issue #48 的三个失败 run(41272108184 / 41392461949 / 41432215926)两次失败 job 完全相同:test (ubuntu-latest, 3.9) 与 oldest-deps。

日志显示两者都死在 actions/setup-python@v5:

##[error]The version '3.9' with architecture 'x64' was not found for Ubuntu 26.04.

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 通过。
  • 矩阵展开核对:12 个 job,3.9 在 ubuntu-24.04 与 macos-latest,其余在 ubuntu-latest。
  • 本地 CPython 3.9.6 全量:137 passed,--cov-fail-under=98 通过 → 代码本身在 3.9 无问题,失败纯属 runner 镜像。
  • 本 PR 的 CI 即为真机验证。

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 构建版本。

改进:

  • 将 Python 3.9 的测试任务和最旧依赖项任务固定为使用 Ubuntu 24.04,同时继续让较新 Python 版本使用 ubuntu-latest。

CI:

  • 更新 CI 矩阵,使 Python 3.9 在 Ubuntu 24.04 和 macOS 上运行,避免在 Ubuntu 26.04 上进行不受支持的环境配置。
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:

  • Keep Python 3.9 CI coverage working after ubuntu-latest moves to Ubuntu 26.04, where a compatible Python 3.9 build is unavailable.

Enhancements:

  • Pin Python 3.9 test and oldest-dependency jobs to Ubuntu 24.04 while retaining ubuntu-latest for newer Python versions.

CI:

  • Update the CI matrix to run Python 3.9 on Ubuntu 24.04 and macOS, avoiding unsupported Ubuntu 26.04 setup.

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)
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b7a72b76-ea50-446c-aad9-5182ec016356
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@changeset-bot

changeset-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8f5592c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sourcery-ai

sourcery-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor
审阅者指南(小型 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
Loading

文件级变更

变更 详情 文件
将 Python 3.9 的 Ubuntu CI 执行环境固定到 Ubuntu 24.04,以规避 Ubuntu 26.04 缺少对应 setup-python 构建的问题。
  • 在测试矩阵中为 Python 3.9 增加 ubuntu-24.04,并排除 ubuntu-latest 上的 Python 3.9;其他 Python 版本保持使用 ubuntu-latest。
  • 将 oldest-deps job 固定到 ubuntu-24.04,因为该 job 使用 Python 3.9。
  • 补充触发原因和未来删除条件的维护注释。
.github/workflows/ci.yml

可能关联的问题


提示和命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论创建 GitHub issue: 回复审查评论,请 Sourcery 根据该评论创建 issue。你也可以在审查评论中回复 @sourcery-ai issue 来创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,以随时(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中你希望显示摘要的位置写入 @sourcery-ai summary,即可随时生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,以随时(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已处理完所有评论且不想再看到它们,这会很有用。
  • 关闭所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可关闭所有现有的 Sourcery 审查。如果你想重新开始一次审查,这尤其有用——别忘了评论 @sourcery-ai review 以触发新的审查!

自定义使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English
Reviewer'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 selection

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
Loading

File-Level Changes

Change Details Files
将 Python 3.9 的 Ubuntu CI 执行环境固定到 Ubuntu 24.04,以规避 Ubuntu 26.04 缺少对应 setup-python 构建的问题。
  • 在测试矩阵中为 Python 3.9 增加 ubuntu-24.04,并排除 ubuntu-latest 上的 Python 3.9;其他 Python 版本保持使用 ubuntu-latest。
  • 将 oldest-deps job 固定到 ubuntu-24.04,因为该 job 使用 Python 3.9。
  • 补充触发原因和未来删除条件的维护注释。
.github/workflows/ci.yml

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你好——我已经审阅了你的更改,整体看起来很棒!

Sourcery 评估

已批准。


Sourcery 对开源项目免费——如果你喜欢我们的评审,欢迎考虑分享 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@im47cn
im47cn merged commit f003698 into main Nov 3, 2026
24 checks passed
@im47cn
im47cn deleted the fix/ci-py39-ubuntu-24 branch November 3, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants