tests.test_pyproject module

Consistency checks tying the test matrix to the declared dependencies.

The click version axis of the test matrix is the one dependency whose whole supported range is exercised release-by-release (a patch can change behavior mid-stream). These tests keep that axis in sync with the click dependency specifier, so a drift, like a new Click release or a raised floor, fails CI instead of silently rotting.

tests.test_pyproject.PYPROJECT = PosixPath('/home/runner/work/click-extra/click-extra/pyproject.toml')

Path to the project’s pyproject.toml, relative to this test file.

tests.test_pyproject.SENTINELS = ('released', 'stable', 'main')

Moving-reference values of the click-version axis: the lockfile-resolved release, and Click’s stable and main development branches. Everything else in the axis is a pinned release number.

tests.test_pyproject.UV_LOCK = PosixPath('/home/runner/work/click-extra/click-extra/uv.lock')

Path to the project’s uv.lock, which holds the Click released cells run.

tests.test_pyproject.load_click_matrix()[source]

Read the Click setup from pyproject.toml.

The click-version axis is spread across the forward-looking test-matrix.full-include rows (the pinned releases and the stable / main sentinels) and the released default declared in test-matrix.include.

Return type:

tuple[SpecifierSet, list[str], set[str]]

Returns:

the click dependency specifier, the collected click-version axis values, and the subset that are pinned release numbers (sentinels start with a letter, pinned versions with a digit).

tests.test_pyproject.stable_pypi_versions(package)[source]

Return all non-yanked, non-prerelease versions of package on PyPI.

Return type:

set[Version]

tests.test_pyproject.locked_versions(package)[source]

Return the versions of package that uv.lock pins.

A released cell installs from the lock with uv run --frozen, so it runs this version, not the newest one on PyPI: the cooldown keeps a new release out of the lock for a week.

Return type:

set[str]

tests.test_pyproject.test_click_floor_is_pinned_and_sentinels_present()[source]

The matrix floor stays in sync with the dependency floor (hermetic).

The lowest pinned click-version must equal the lower bound of the click specifier, so raising or lowering the dependency floor without updating the matrix (or vice versa) fails here. Runs offline, unlike the PyPI cross-check below.

tests.test_pyproject.test_click_matrix_matches_authorized_releases()[source]

The pinned releases match exactly the Click releases the specifier allows.

Every release allowed by the click specifier must be referenced in the matrix: the locked one through the released sentinel, every other one by an explicit pin. This asserts the set equality in both directions:

  • a missing pin means a Click release that no cell runs, like a new release that the cooldown still keeps out of uv.lock;

  • a stale pin means a pinned version is no longer an authorized release (the floor was raised past it, or the release was yanked).

Either way, the matrix needs an edit, and this is the signal. There is no exemption list: a release the suite cannot run on gets its own answer at the moment it appears, whether that is a floor bump past it or a hole opened here on purpose.

tests.test_pyproject.test_nuitka_includes_every_lazy_subcommand_module()[source]

A Nuitka build bundles the module of each lazily mounted subcommand.

Nuitka follows import statements only, while a lazy subcommand is imported from a string: a module missing here ships a binary whose subcommand fails.