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.toml and the generated matrix, so they answer the same on every OS and Python: the once-tests job 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-python floor equals the lowest declared classifier.

A network-free companion to the matrix check below: it catches a requires-python bump 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-python floor.

Drives the real repomatic CLI, 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-package escape hatch is the documented per-package exemption every uvx call carrying this pin needs. The workflow sets UV_EXCLUDE_NEWER for 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 the skip branch 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 from requires-python.