Repository navigation
Description
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.ymland to the README's test commands. - Fixtures: the existing
uv.lock, plus apoetry.lock, apdm.lockand apylock.toml. Base their shape on wheelgap's owntests/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). Leavepixi.lockout: 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'slabel(True). SetXDG_CACHE_HOMEtotmp_path. Then rundriver.check(root, lock, options)with the same Pythons and platforms. - Compare, using the
--jsonshape in wheelgap'sdocs/wheelgap-output.schema.jsonat the pinned tag:- the set of packages with
sourceormissingon some target equals the driver's rows that havegaps; - each row's
statusesequal the CLI'sresultsfor that package, on every target; per_targetequals the counts over the CLI's packages;packagesandskippedmatch the CLI's.
- the set of packages with
- 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; seecheck()'s docstring), andtest_check_doesnt_count_pythons_outside_the_lockalready 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 countingunknownas a gap, or dropping the marker-limited package'sn/a. Say in the PR which changes you tried. - It runs in CI's "Repo checker driver" step, and the plain
pytestrun still skips it when wheelgap isn't installed.
Activity