Skip to content

ci(compat): compile the 3.8-floor util scripts on the 3.8 leg (#2206) - #2214

Merged
JarryShaw merged 1 commit into
mainfrom
ci/2206-compile-util-on-3-8
Oct 26, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
ci/2206-compile-util-on-3-8

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • ci — CI configuration

Description

Closes #2206 (option B). ast.parse(feature_version=(3, 8)) is best-effort on newer interpreters, so a real 3.8 now compiles the 3.8-floor util/ scripts.

  • Step: Compile the 3.8-floor util scripts on the Compat Python 3.8 (KTLO) leg, after Verify package.
    • It follows that step's pattern: a log file, an ANNOTATION_LEVEL annotation, continue-on-error and LEG.
    • It runs only when the install succeeded and the leg is 3.8. The '3.8' literal gets an [[exemptions]] entry in .github/python-versions.toml.
  • No drift: test_compat_util_floor_2206.py finds every tests/project test that parses a util/ script at FLOOR. The step's file list must equal that set. python_versions.py, held to 3.11, is left out.
  • Scanner: test_ktlo_legs_stay_green_1672.commands() treats paths on a -m compileall line as compiled, not run.
  • Prose: the floor tests' docstrings say the check is best-effort, and that this step is authoritative. workflows.rst describes the step.
  • Fail-without-fix: the new tests give 5 failed on origin/main. Dropping one script from the step fails the drift check. The scanner test gives 2 failed against the old commands().
  • Tests run: the core group gives 534 passed, and the docs and workflow group 420 passed. actionlint is clean. The step's script itself runs under 3.14 in TestAScriptThatDoesNotCompileFailsTheStep.

Problem: the util floor tests check 3.8 syntax with ast.parse(...,
feature_version=(3, 8)), which is best-effort: on 3.14 it accepts
parenthesized context managers, relaxed decorators, a[*b] and reused
f-string quotes.

Fix: `Compile the 3.8-floor util scripts` on Compat Python 3.8 (KTLO)
runs `python -m compileall -q` over the scripts those tests hold to 3.8,
masked and annotated as `Verify package` is. Its 3.8 gate is an exemption
in python-versions.toml. The KTLO annotation scan no longer reads a
script that compileall names as one the step runs. The floor tests'
docstrings and workflows.rst name that step as the authoritative check.

Test: test_compat_util_floor_2206 runs the floor tests with ast.parse
recorded and requires the step's list to equal what they parse at 3.8,
the gate to hold on the floor leg alone, and a syntax error to fail the
step with one annotation. A scanner test covers compileall arguments.
@JarryShaw JarryShaw added test Pull requests that add or correct tests (test: subject prefix) ci Pull requests that change CI or workflow configuration (ci: subject prefix) review: running A cross-review is in flight against the current head - no verdict yet labels Oct 25, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at c8642f8d8 (Sonnet).

  • Real 3.8 (mise 3.8.20): the step's script compiles the unmodified util/ scripts with exit 0. With a parenthesized with added to release_tags.py, it prints the KTLO warning annotation naming util/release_tags.py, line 138 and exits 1. It compiles 8 named files, so python_versions.py is left out.
  • Gate: it fires on the 3.8 leg only, and only after a successful install. Moving it to '3.9' fails the test. The '3.8' literal is registered as an exemption.
  • Drift check: dropping a script from the step fails it, and so does a floor test parsing a 3.11 script. A skipped floor test raises rather than shrinking the set.
  • Fail-without-fix: 5 failed on origin/main. The scanner change is needed: one test fails against main's commands().
  • Tests: 457 passed on the head.
  • Not blocking: the COMPILEALL regex would hide a util/*.py run that shares a line with compileall, which no workflow does.

@JarryShaw JarryShaw added review: good-to-go Cross-review at the current head says ready; CI state is separate and removed review: running A cross-review is in flight against the current head - no verdict yet labels Oct 25, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.56% (unit tier, Python 3.15, c8642f8d8, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19599 881 2618 867 92.11%
pcapkit/corekit 2589 74 816 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 2994 23 1038 25 98.81%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17433 218 4584 185 98.15%
pcapkit/toolkit 869 36 298 10 95.20%
pcapkit/utilities 504 7 146 5 98.15%
pcapkit/vendor 4432 1988 1018 167 51.87%

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

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge at c8642f8d8. Closes #2206 (option B).

  • Review: Sonnet GOOD TO GO, first round. It ran the step under a real 3.8.20 and confirmed injected 3.10 syntax fails it.
  • CI: all checks complete, Required checks passed SUCCESS, 0 failed. On Compat Python 3.8 (KTLO), Compile the 3.8-floor util scripts ran and succeeded, with no annotations.
  • KTLO: 12 legs, no warnings.
  • Ordering: merged into main and run. project leg: 2304 tests, 0 failures.
  • Conflicts: none against the current main. docs(contributing): sixth whole-repo pass over the non-API docs (#1103) #2213 also edits workflows.rst, so whichever lands second needs a rebase.

@JarryShaw JarryShaw added this to the PyPCAPKit v1.5 milestone Oct 26, 2026
@JarryShaw
JarryShaw merged commit 7f2c0fe into main Oct 26, 2026
69 checks passed
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 26, 2026
@JarryShaw
JarryShaw deleted the ci/2206-compile-util-on-3-8 branch October 26, 2026 03:10
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 26, 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) test Pull requests that add or correct tests (test: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test(project): ast feature_version=(3, 8) accepts 3.9–3.12 syntax, so the util floor tests under-check

1 participant