Skip to content

Repo checker: test that its answer matches the wheelgap CLI for every file format it reads - #198

Merged
patrickballard merged 3 commits into
mainfrom
test/checker-parity-189
Nov 21, 2026
Merged

patrickballard merged 3 commits into
mainfrom
test/checker-parity-189

Conversation

@patrickballard

Copy link
Copy Markdown
Contributor

Closes #189

The checker promises to say what uvx wheelgap says on the same file. This adds the test of that promise.

What changed

  • New tests/test_check_parity.py. For each file format the page reads, it runs the pinned CLI in a subprocess (sys.executable -m wheelgap <file> --json -p 3.13,3.14 -t linux-x86_64,linux-aarch64,musl-aarch64,win-arm64) and driver.check() with the same Pythons and platforms, then compares:
    • the targets and their labels;
    • every row's statuses with the CLI's results for that package, on every target, and that a package has a row exactly when the CLI gives it source, missing or unknown somewhere;
    • each row's gaps, unknown and keep lists;
    • per_target with the counts over the CLI's packages, and with the CLI's own summary.per_target;
    • packages and skipped.
  • The lockfiles that list their files (uv.lock, poetry.lock, pdm.lock, pylock.toml) run with --offline. Each has a package with a wheel everywhere, one that is source on some targets, one that is missing on some, one limited by a marker (n/a), one no target installs, and the project or a local folder (skipped).
  • The files Repo checker: check requirements files, pyproject.toml and Pipfile.lock by looking packages up on PyPI from the browser #195 added (requirements.txt with an include, pyproject.toml, Pipfile.lock, pixi.lock) are covered too, although the issue was written before them. The CLI looks packages up on a server the test runs on 127.0.0.1 (WHEELGAP_INDEX_URL); the driver gets the same canned PyPI JSON for the lookups needs() names, keyed as worker.mjs keys it. These add a range that resolves to a different release per Python, a 404 (unknown), and private-index, git and path packages (skipped).
  • The test runs in CI's "Repo checker driver" step and is in the README's test commands. The plain pytest run skips it when wheelgap isn't installed.

Not compared, on purpose

  • Pythons outside a lock's requires-python, and a Pipfile.lock or requirements file that names a second index: there the page and the CLI differ by design, and test_check_driver.py covers both.
  • The lookup flag on rows (it only decides which fixes are fetched).

How it was tested

  • The full check.yml command list locally. The driver step gives 36 passed, 6 skipped (the skips are the existing gap-wheel tests).
  • The same step with HTTPS_PROXY pointed at a dead port and uvx --offline: still passes, so nothing leaves the machine.
  • Broke driver.check() on purpose, one change at a time. Each made the new file fail:
Change to driver.py Failing tests (of 8)
unknown counted as a gap 4 (the looked-up files; the lockfiles have no unknown)
a marker-limited package's n/a read as wheel in statuses 8
n/a counted as wheel in per_target 8
missing not counted as a gap 8
skipped emptied 6
packages counting every listed package 6
looked-up files: rows no target installs kept 3
looked-up files: a 404 read as "no files" 4
looked-up files: a range resolved for the first Python only 2

🤖 Generated with Claude Code

patrickballard and others added 3 commits November 21, 2026 00:43
… file format it reads

The checker promises to say what uvx wheelgap says on the same file, and hands people the command to compare with, but nothing tested that: driver.check() works its counts, rows and skipped list out itself, on a private API, and the pin moves with every release. tests/test_check_parity.py runs the pinned CLI and driver.check() on the same uv.lock, poetry.lock, pdm.lock, pylock.toml, requirements.txt, pyproject.toml, Pipfile.lock and pixi.lock and compares every status, count and skipped package. No network: the lockfiles run with --offline, the looked-up files against canned PyPI JSON served on 127.0.0.1.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
XDG_CACHE_HOME moves wheelgap's cache only on Linux; on macOS and Windows the looked-up tests saved fixture answers into the real cache. They pass --no-cache now.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@patrickballard
patrickballard merged commit 564664f into main Nov 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant