repomatic.metadata.matrix module¶
Job-matrix construction of Metadata.
Builds the Nuitka build matrix and the test matrices from the other
concerns’ facts, and applies the repository’s [tool.repomatic]
test-matrix configuration to them.
- class repomatic.metadata.matrix.MatrixMetadata[source]¶
Bases:
objectThe Nuitka build matrix and the test matrices.
A concern mixin of
Metadata: never instantiated on its own, and reads sibling concerns throughself.- property nuitka_matrix: Matrix | None[source]¶
Pre-compute a matrix for Nuitka compilation workflows.
Crosses three axes:
one commit per release commit (during a release) or per new commit (otherwise)
every
[project.scripts]entry pointevery build target of
NUITKA_BUILD_TARGETS(runner, platform, architecture, binary extension, and the glibc floor or minimum-OS version that target enforces), narrowed to the[tool.repomatic] nuitka.dev-targetscanary subset on an ordinary push (seedev_targets); release commits,scheduleandworkflow_dispatchruns keep the full roster
Each axis contributes an
includeentry carrying the extra parameters the compile job needs, keyed on the axis value that selects it: the target’s runner and floors, the entry point’s module and callable, and the commit’s short SHA and version. A final pass adds oneincludeentry per(os, entry_point, commit)triple naming thebin_namethe compiled artifact takes, since that name depends on all three at once.The matrix closes with
{"state": "stable"}, which the release workflow reads to decide whether a failing job blocks the release.Note
Every value comes from
NUITKA_BUILD_TARGETSand the project’s ownpyproject.toml, so no literal is repeated here: runrepomatic show-metadata nuitka_matrixagainst a project to see the matrix it computes, orrepomatic show-test-matrixfor the test one.Note
Each entry point compiles through Nuitka’s
--main-entry-point, which needs Nuitka4.3. Earlier releases crashed on the option (Nuitka#3879), or built a binary that failed at startup when the entry point carried the name of its package (Nuitka#4024).
- property test_matrix: Matrix[source]¶
Full test matrix for non-PR events.
Combines all runner OS images and Python versions, excluding known incompatible combinations. Marks development Python versions as unstable so CI can use
continue-on-error, and adds released build flavors (free-threaded) as stable single-runner smoke tests. Per-project config from[tool.repomatic.test-matrix]is applied last.When
[tool.repomatic.test-matrix] full-includerows are configured, the matrix is emitted as a flat job list ({"include": [...]}) so each row is a standalone combination GitHub runs verbatim, rather than one that augments a base combo sharing itsosandpython-version.
- property test_matrix_pr: Matrix[source]¶
Reduced test matrix for pull requests.
Skips experimental Python versions and redundant architecture variants to reduce CI load on PRs. Per-project config excludes and includes from
[tool.repomatic.test-matrix]are applied, but variations are not (to keep the PR matrix small).
- property runner_arch: dict[str, str][source]¶
Architecture of every runner image the full test matrix can land on.
A repository whose suite asserts on the architecture it detects needs to know which of its cells are ARM. Reading it from here rather than restating it locally is what keeps that knowledge from going stale when
TEST_RUNNERS_FULLmoves to a newer image: a hard-coded runner list keeps matching the images it was written for, and the new one quietly takes whichever branch the test left as its default.Covers the
includedirectives as well as theosaxis, so the single-runner build-flavor cells (seeSINGLE_RUNNER_PYTHON_VERSIONS) are described too, and the per-projectvariations.osimages along with them. Architectures are emitted as Extra Platforms ids (aarch64,x86_64), matching thearchfield ofFLAT_BUILD_TARGETS.- Returns:
Runner label to architecture id, sorted by label.
- property stale_test_matrix_excludes: list[tuple[dict[str, str], dict[str, str]]][source]¶
User
test-matrix.excludeentries matching no full-matrix axis value.An exclude naming a value absent from every axis (like a renamed runner) can never match a combination, so
Matrix.prune()drops it silently and its exclusion intent is lost. This drift is common after an upstream runner rename (such asmacos-15-intelbecomingmacos-26-intel). Thelint-repocheck surfaces these so the drift fails loudly instead of silently.The axes come from
_test_matrix_base, never from the emittedtest_matrix: afull-includematrix emits as a flat job list whoseall_variations()is empty, which would misreport every key of an entry as stale. Carrying the absent values in the result is what keeps the lint check from re-deriving them against the wrong matrix.- Returns:
(entry, absent_values)pairs in config order: each offending exclude with the key/value pairs no axis carries.