tests.test_metadata module¶
Guard the CI test matrix against drifting away from the project metadata.
repomatic generates the GitHub Actions test matrix from a hard-coded set of
Python versions, independently of the project’s requires-python. Nothing
forces the two to agree, so a requires-python bump that forgets the matrix,
or a repomatic release that shifts its floor, would silently leave the
declared floor untested. These tests turn that drift into a failing check, as
recommended by repomatic’s test-matrix guide.
- tests.test_metadata.pytestmark = MarkDecorator(mark=Mark(name='once', args=(), kwargs={}))¶
These read
pyproject.tomland the generated matrix, so they answer the same on every OS and Python: theonce-testsjob runs them on a single runner.
- tests.test_metadata.PYTHON_CLASSIFIER_PREFIX = 'Programming Language :: Python :: '¶
Prefix of the trove classifiers enumerating supported Python versions.
- tests.test_metadata.test_requires_python_floor_in_classifiers()[source]¶
The
requires-pythonfloor equals the lowest declared classifier.A network-free companion to the matrix check below: it catches a
requires-pythonbump that forgets to update the trove classifiers, or the reverse, the most common metadata drift.
- tests.test_metadata.test_matrix_python_floor_matches_requires_python()[source]¶
The generated matrix’s lowest Python equals the
requires-pythonfloor.Drives the real
repomaticCLI, the same one CI invokes, so the assertion reflects what is actually tested rather than a re-derivation. Skips, instead of failing, when the tool cannot be fetched (offline or sandboxed builds).The
--exclude-newer-packageescape hatch is the documented per-package exemption everyuvxcall carrying this pin needs. The workflow setsUV_EXCLUDE_NEWERfor all of its jobs, so a pin just moved to a release published inside that window is unresolvable without it, and uvx exits non-zero. That lands in theskipbranch below rather than a failure, which is the worse outcome: this guard would go quiet for a full cooldown period after every upstream bump, exactly when the matrix is most likely to have drifted fromrequires-python.