Skip to content

Repo checker: test that its answer matches uvx wheelgap for every lockfile format it reads #189

Closed

Description

@patrickballard

The repo checker promises to say what uvx wheelgap says on the same lock (the driver.py docstring), and its "Run the same check locally" box hands people the command to compare with. If someone runs that command and gets a different answer, they stop trusting both, and they won't act on the fixes either.

Nothing tests that promise today. tests/test_check_driver.py runs site/check/driver.py with the pinned wheelgap, but only on one hand-written uv.lock, and only against values written into the test. It never compares the driver's output with the CLI's, and poetry.lock, pdm.lock and pylock.toml aren't tested at all. Yet driver.check() works several things out for itself: the per-target counts, which targets count (outside_lock), which packages get a row, every status keyed by its own labels, and the skipped list. It does this on top of a private API (api._check_lockfile), and the pin moves with every wheelgap release. A change on either side could make the page and the CLI disagree, and no test would fail.

What to do

  • Add the test to tests/test_check_driver.py, or to a new file that the same CI step runs. If it's a new file, add it to the "Repo checker driver" step in .github/workflows/check.yml and to the README's test commands.
  • Fixtures: the existing uv.lock, plus a poetry.lock, a pdm.lock and a pylock.toml. Base their shape on wheelgap's own tests/fixtures/ (poetryproj, pdmproj, pylockproj) at the pinned tag. Each one needs: a package with a wheel everywhere, one with only an sdist for some targets (source), one with no file at all for a target (missing), one limited by a marker (n/a), and the project itself (skipped). Leave pixi.lock out: it can't be checked offline (Repo checker: a pixi.lock is offered as checkable, then fails with wheelgap's offline=True error #185).
  • For each fixture, run the CLI in a subprocess with the same interpreter: sys.executable -m wheelgap <lock> --offline --json -p 3.13,3.14 -t linux-x86_64,linux-aarch64,musl-aarch64,win-arm64. With two Pythons, its result keys look like "3.13 linux-x86_64", the same as the driver's label(True). Set XDG_CACHE_HOME to tmp_path. Then run driver.check(root, lock, options) with the same Pythons and platforms.
  • Compare, using the --json shape in wheelgap's docs/wheelgap-output.schema.json at the pinned tag:
    • the set of packages with source or missing on some target equals the driver's rows that have gaps;
    • each row's statuses equal the CLI's results for that package, on every target;
    • per_target equals the counts over the CLI's packages;
    • packages and skipped match the CLI's.
  • Keep every Python inside each fixture's requires-python. Outside it, the page and the CLI differ on purpose (the CLI rechecks those Pythons on PyPI; see check()'s docstring), and test_check_doesnt_count_pythons_outside_the_lock already covers that.

Done when:

  • All four lockfile formats go through both the CLI and the driver, and the comparison passes on the pinned wheelgap, with no network.
  • Breaking driver.check() on purpose makes it fail, for example counting unknown as a gap, or dropping the marker-limited package's n/a. Say in the PR which changes you tried.
  • It runs in CI's "Repo checker driver" step, and the plain pytest run still skips it when wheelgap isn't installed.

Activity

  1. added
    help wanted
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions