Add optional multi-version Python test matrix#26
Conversation
Generated repositories can now opt into CI testing across multiple Python versions via a new multi_python_tests boolean answer (default false). When enabled, the generated CI workflow gains a typecheck-test matrix job modelled on the estate's library repositories (femtologging, falcon-correlate, and cuprum): one leg per Python minor version from the project's python_version baseline through 3.14, plus an experimental 3.15 lane that installs prerelease interpreters and sets continue-on-error so it never gates merges. Lint, audit, and coverage stay single-legged in lint-test, and Rust-enabled variants set up the toolchain in every leg because make build compiles the extension. When the toggle is off, the rendered CI workflow is byte-identical to the previous output. Contract tests cover both toggle states and a reduced matrix for a 3.14 baseline, and the developers' guide documents the behaviour.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 6 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary
Adds an optional multi-version Python test matrix to the template, selectable at render time, modelled on the estate's existing practice:
build-testmatrix over 3.12/3.13/3.14 with a 3.15 experimental lane excluded from required checks;typecheck-testlegs plus a3.15aexperimental leg withcontinue-on-error: true.The template's CI is a single
lint-testjob, so the change follows cuprum's shape:lint-testis untouched and a newtypecheck-testmatrix job is added when the toggle is on.Toggle semantics
New
copier.ymlbooleanmulti_python_tests(defaultfalse). Help text notes it suits libraries for external consumption; the estate baselines libraries at 3.12 and tests 3.12–3.14. No hidden computed variable was needed — the version list is derived inline inci.yml.jinja.Version derivation
The matrix is derived in Jinja from the existing
python_versionanswer: one stable leg per minor version fromrange(python_version minor, 15)(so a3.10baseline yields 3.10–3.14; a3.14baseline yields just 3.14), plus a final experimental legpython-version: '3.15', labelled3.15aper cuprum, withallow-prereleases: true.Experimental lane is non-gating
The job carries
continue-on-error: ${{ matrix.experimental }}andstrategy.fail-fast: false; legs are namedTypecheck and test (Python <label>)so required-check names stay predictable and the3.15aleg can be left out of branch protection.Design notes
make audit, Makefile validation, and coverage (plus the CodeScene upload) stay single-legged inlint-test, matching the models. Each matrix leg runsmake build,make typecheck, andmake testonly. Note the 3.13-ish leg re-runs tests thatlint-testalso runs via the coverage action — cuprum accepts the same duplication.use_rust, every leg sets up the Rust toolchain (sharedsetup-rustat the template's existing pin) andSwatinem/rust-cache(which keys on matrix values automatically), becausemake buildcompiles the PyO3 extension per interpreter — mirroring cuprum and femtologging's per-leg toolchain setup.${{ "{{" }} … {{ "}}" }}escaping, and indented-tag trailing-whitespace conventions match the existingci.yml.jinja. The outer toggle uses Jinja whitespace control so the off-state output carries no residue.Validation
python_version=3.14reduced-matrix case withuvx copier copy.mainfor both Rust states (verified withdiff).ci.ymlYAML-parses and passesactionlintcleanly.🤖 Generated with Claude Code