feat: declare and test support for Python 3.14 - #360
Merged
Merged
Conversation
The full suite passes on 3.14 unchanged, so this only adds the classifier, the tox env, and the CI matrix entry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
v4 is old enough that provisioning 3.14 is not a safe assumption. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Python 3.14 implements PEP 649, so a bare `_children_layout:` class annotation is no longer evaluated at class-body time and coverage stops counting it as executed. That dropped the total from 95.5% to 94.7% and tripped fail_under=95, failing the 3.14 job with every test passing. These are type declarations with no runtime behaviour, so excluding them makes the metric version-independent: 3.9/3.13/3.14 now agree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rddimon
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Python 3.14 is out and the package already works on it — all 1534 tests pass on 3.14.2 with no
source changes. This adds the trailing metadata so that support is declared on PyPI and enforced
in CI, rather than being true by accident.
Independent of the
hcl2.climove in #359; either can merge first.Changes
Programming Language :: Python :: 3.14classifier topyproject.toml.requires-pythonstays>=3.8.0, so no floor moves.{py314}-unitto the toxenvlistand a3.14: py314-unitentry to the[gh-actions]mapping.
'3.14'to thepr_check.ymltest matrix.actions/setup-pythonfrom@v4to@v5inpr_check.yml. Left as a plain tagdeliberately — Renovate SHA-pins
uses:refs on its next run._children_layout:annotations from coverage in.coveragerc(see below).No source changes.
Why the coverage config had to change
The first 3.14 run failed with every test passing:
Ran 1534 tests ... FAILED, no failure orerror counts. The culprit was the coverage gate, not the suite.
Python 3.14 implements PEP 649, which defers evaluation of
annotations. A bare class-level annotation like
_children_layout: Tuple[...]— used 45 timesacross
hcl2/rules/and documented in CLAUDE.md as "annotation only, no assignment" — is nolonger executed during class-body evaluation; it is compiled into a lazily-invoked
__annotate__function. Coverage therefore stops counting those lines as executed:
.coveragercsetsfail_under = 95, so 3.14 tripped it by 0.3pp andnose2's coverage pluginmarked the run unsuccessful — which surfaces as a bare
FAILEDwith no failing test, since theplugin sets
event.success = Falsewithout adding anything to a report category.These annotations are type declarations with no runtime behaviour, so counting them as executed
statements was always an artifact of pre-PEP-649 semantics. Excluding them makes the metric
version-independent — after the change 3.9, 3.13 and 3.14 all land at 95.4–96%.
Test plan
Verified against real interpreters using the exact CI command (
nose2 --config tox.ini), notpython -m unittest:Ran 1534 tests ... OK, exit 0, coverage 95.387%Ran 1534 tests ... OK, exit 0, coverage 95.487%Ran 1534 tests ... OK, exit 0, coverage 96%_children_layoutstatements (3956 → 3913),not any executable code
GITHUB_ACTIONS=true tox -lunder 3.14 resolves to exactlypy314-unitlark1.3.1 andregex2026.9.10 install cleanly on 3.14bin/check_deps.pypassesNote: the 3.14 leg builds
coveragefrom source —test-requirements.txtpinscoverage>=6.5,<7and 6.5.0 has no cp314 wheel. It compiles fine, but adds a build step.Follow-ups, out of scope here
.coveragercomitscli/__init__.py. Once fix: move the CLI into the hcl2 namespace (cli → hcl2.cli) #359 lands that path ishcl2/cli/__init__.py, andthe omit silently stops matching. Whichever PR merges second should fix it.
dependencies_check.ymlstill usesactions/setup-python@v4,publish.ymlstill uses@v2,and all three workflows check out with
actions/checkout@master.🤖 Co-Authored-By: Claude Opus 5 (1M context) Claude Code