Skip to content

ci(python): a weekly job keeps the Python version tiers current and opens a PR (#1660) - #1716

Merged
JarryShaw merged 1 commit into
mainfrom
ci/1660-python-versions-updater
Oct 14, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
ci/1660-python-versions-updater

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Description of your pull request and other information

Part B of #1660: cron-python-versions.yml recomputes .github/python-versions.toml every Monday and proposes the change as a pull request (rulings A, B and C). Design choices to check:

  • A fourth source, actions/runner-images' README, besides python.org's release cycle, PyPy's versions.json and setup-python's manifest: the manifest still lists retired images and cannot say which image ubuntu-latest is.
  • Tiers only move forward: a version enters as supported, moves to KTLO, then is dropped. An end-of-life version the file does not list is never added.
  • A pre-release is held back as a notice, since load() refuses that tier until a workflow runs non-blocking pre-release legs.
  • Audit failures are listed, not blocking: detect runs the three audit modules on the rewritten tree, and the body lists what failed, to finish by hand on the branch.
  • No repeat proposals: while bot/python-versions has an open pull request, detect reads every commit it holds ahead of main (a commits-only fetch, so merges of main are seen through and left out), and tiers already proposed there, hand edits on top or not, get no second push or approval. If the branch holds hand edits and proposes other tiers, detect fails rather than ask for an approval that publish would refuse.
  • A merged or closed proposal's branch is stale: with no open pull request (delete_branch_on_merge is off), detect proposes afresh and publish recreates the branch from main. So a proposal closed unmerged comes back the next Monday. detect gains pull-requests: read to read that state.
  • No workflow file is written: the App token has no workflows permission, so it cannot push one. Workflow comments name the tiers rather than restate them.
  • Release counts follow the tag: once a version is tagged, version_check counts the wheels and conda builds in the tier file at the tag's commit. For v1.5.0b12, which predates the file, it uses the file as ci(python): declare the version tiers and the latest version in one file (#1660) #1677 added it. Merging a new supported version therefore no longer re-runs pypi for a finished release and fails fix(ci): Create Release tags main's tip at approval time, not the commit it was created for #1634's tag check.

One-time setup: add Pull requests: read and write to the release App, then accept the new permission on its installation.

First run, on today's sources: pypy3.12 joins the supported tier. The ruleset needs no edit, and the audit passes.

Tests: test_python_versions_update_1660.py holds 53 tests against 2026-10-13 snapshots of the four sources; every one fails or errors on main. test_release_tags_the_run_sha_1634.py gains a scratch-repository class for the release counts. The seven affected modules pass on 3.14 and 3.15, and on 3.8 and 3.10 where they do not skip. actionlint reports only what it already reports on main.

Part of #1660

…pens a PR (#1660)

- util/update_python_versions.py recomputes .github/python-versions.toml from
  python.org's release cycle, PyPy's versions.json, setup-python's
  versions-manifest.json and the runner-images README, for the labels the
  workflows run on. It rewrites the tier file line by line (a no-op run is
  byte-identical), regenerates the prose the audit pins, lists the renamed
  check runs and the ruleset edits, and holds a pre-release back.
- cron-python-versions.yml: weekly and on dispatch, permissions {} by default.
  detect runs it and the audit with no secret; while the branch's pull request
  is open it skips tiers a commit ahead of main proposes, merges of main left
  out. pr, behind github-release, mints a release App token with contents and
  pull requests write, force-pushes bot/python-versions only, or recreates it
  once its pull request is merged or closed, and opens or updates that PR.
- Workflow comments no longer restate the tiers, since that token cannot push
  a workflow file; coverage-comment.yml reads the leg's version from the artifact.
- create-release.yml: once a version is tagged, version_check counts the wheels
  and conda builds in the tier file at the tag's commit, not the run's.
- Tests against committed source snapshots and scratch repositories.

The seven affected tests/project modules pass; the new module's 53 fail on main.
@JarryShaw JarryShaw added ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: good-to-go Cross-review at the current head says ready; CI state is separate labels Oct 14, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at d2b0904df (rebased onto 9808d51d3). A Sonnet cross-review checked three rounds.

  • Proposal tracking: detect sees a proposal anywhere on bot/python-versions, including behind a merge of main. On github.com, the commits-only fetch found all 5 commits of wip/443-gap-intervals; the old shallow fetch found 2. A real hand edit still blocks.
  • Stale branch: a branch with no open PR is recreated from main.
  • Tier counts: Create Release judges an already-tagged version against the tier file at its tag's commit. For v1.5.0b12, which predates the file, it uses the file as first added; that equals b12's hard-coded counts.
  • Permissions: detect holds no secrets, only contents: read and pull-requests: read. The PR job mints the App token with exactly contents and pull-requests write, inside github-release.
  • Tests: 344 across the seven modules on 3.14 and 3.15; the new module's 53 fail on main.
  • Not verified: the token push, the approval flow and a real end-to-end run. Workflows may not be triggered from here, so the first scheduled run will show them.

Two behaviours need your decision before this merges:

  1. A proposal you close without merging comes back the next Monday, with the github-release approval asked again each week.
    • Recommended: remember the fingerprint of a proposal closed unmerged, and re-propose only when the tiers change.
    • Alternative: keep as is.
  2. A merge of main that carries conflict-resolution edits is treated as a plain merge, so a later publish would overwrite those edits.
    • Recommended: treat a merge whose tree differs from a clean merge as a hand edit.
    • Alternative: keep as is.

One-time setup: add Pull requests read and write to the pypcapkit-release App.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 89.47% (unit tier, Python 3.15, d2b0904df, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 3 20 3 95.16%
pcapkit/const 18860 954 2368 868 91.06%
pcapkit/corekit 2372 67 762 35 96.49%
pcapkit/dumpkit 275 3 100 3 98.40%
pcapkit/foundation 3035 151 1076 34 94.28%
pcapkit/interface 138 7 52 5 93.68%
pcapkit/protocols 17166 226 4580 190 98.07%
pcapkit/toolkit 1437 281 592 6 77.97%
pcapkit/utilities 494 4 146 4 98.75%
pcapkit/vendor 4417 2342 1010 157 43.38%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit e6b5aa0 into main Oct 14, 2026
52 checks passed
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 14, 2026
@JarryShaw
JarryShaw deleted the ci/1660-python-versions-updater branch October 14, 2026 13:08
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Pull requests that change CI or workflow configuration (ci: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant