Repository navigation
Cross-check the scan against pip and publish the agreement rate - #48
Merged
Merged
Conversation
scripts/check_pip.py asks pip (`pip download NAME==VERSION --no-deps --only-binary=:all:`) about the top 200 on four 3.13 targets, with the platform tags from the scan's own wheelgap release, and writes data/agreement.json. scan.yml runs it after the scan without ever failing it, uploads the file and commits it by name; the site shows the rate. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
patrickballard
force-pushed
the
pip-agreement
branch
from
November 12, 2026 18:45
bd88b6b to
0596f5d
Compare
Review fixes for #48: - pip prints "No matching distribution found" when it can't reach PyPI too, so "no wheel" now needs pip's -vv log to show the package's page was fetched, with no retry and no failed fetch. pip runs as `install --dry-run --report` (metadata only), isolated from pip.conf and PIP_* variables, pinned in scan.yml. - Nothing is written (exit 1) when pip couldn't answer more than 5% of the cells; a crash exits 2; the installed wheelgap must be the scan's. - The check is its own read-only job after the scan, so it can't use up the scan's time or fail it. The commit job takes its artifact only if there is one and scripts/check_agreement.py (stdlib) accepts it. - agreement.json adds counts for packages without a pure-Python wheel; the site shows them, the skipped and error counts, and that both sides use wheelgap's tag lists, and hides the line after three days. - Tests for run_pip with a faked subprocess.run, wheelgap_tags, main, write, the validator and the site line (node). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 13, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #19
Made with Claude Code.
What changed
scripts/check_pip.py: for the scan's top 200 (by rank) on3.13 linux-x86_64,3.13 linux-aarch64,3.13 musl-aarch64and3.13 win-arm64, it asks pip what it would install of the version the scan checked:pip install --dry-run --ignore-installed --no-deps --only-binary=:all: --report … --python-version 3.13 --implementation cp --abi cp313 --platform … NAME==VERSION. A dry run picks a file the same waypip downloaddoes, but fetches only the wheel's metadata. It compares pip's answer with the scan'sresults,wheelagainst everything else.-vv, and "no wheel" counts only if the log hasFetched page https://pypi.org/simple/<name>/and noRetrying (orCould not fetch URLline. Anything else is an error.--isolated --no-cache-dir --disable-pip-version-check, everyPIP_*variable is removed from its environment, and its only output is a small report in a temp folder deleted after each run.coverage.json; otherwise the script exits 2. The tags come from itstargets.py, using the glibc, musl and macOS baselines recorded with the scan.data/agreement.json:schema,date,scan,wheelgap,pip,top,targets,packages,checks,matched,mismatches({name, version, target, wheelgap, pip, file}),compiled({packages, checks, matched}for the packages without a pure-Python wheel),skipped(cells the scan couldn't look up) anderrors(cells pip couldn't answer). The README lists each field.scan.yml: the cross-check is now its own job,pip-check, so it can't use up the scan job's 60 minutes or cause the scan to be cancelled before upload. Itneeds: scan, hascontents: read,persist-credentials: false,continue-on-error, a 25-minute job timeout and a 15-minute step timeout. It downloadscoverage.jsonfrom thedataartifact, runs the check with the scan's$WHEELGAPand a pinnedPIP: "pip==26.3", and uploadsagreement.jsonas a separateagreementartifact, only if one was written.commitjob runs whatever happened topip-check(!cancelled() && needs.scan.result == 'success'). It downloads theagreementartifact if there is one. It commits the file only if it's a regular file and passesscripts/check_agreement.py, a stdlib-only check: 1 MB cap, valid JSON, exactly the expected keys, non-negative integer counts, short printable strings, one entry per mismatch, and at most 5% errors. Otherwise it warns and keeps the previous file. So the commit job still runs no third-party code, and only named files underdata/are added.publishnow checksneeds.scan.resultandneeds.commit.resultdirectly instead of!failure(). Otherwise a failedpip-check, an ancestor throughcommit, could block publishing.Site: under the scan line it says, for example, "Cross-checked against pip on 2026-11-12, with wheelgap's own tag lists on both sides: they agree on 100% of 800 checks, and on 100% of the 144 for the 36 packages without a pure-Python wheel (the rest install everywhere). 0 skipped, 0 without an answer from pip. Details".
textContentandcreateElement.dateisYYYY-MM-DDand at most three days old.Tests, all offline:
test_check_pip.py:run_pipwith a fakedsubprocess.run: a wheel, a real no-wheel, retry-then-no-match,Could not fetch URL, another project's page, a timeout, a non-zero exit with a wheel in the report, exit 0 without a wheel, exit 0 with two wheels, andPIP_*dropped;wheelgap_tagswith a stand-inwheelgap.targets(it keeps the libc versions and refuses pyodide);write;main's exit codes and the version refusal.test_check_agreement.py: the validator.test_site_agreement.py:renderAgreementin node with a stub DOM. It's skipped without node; the Check workflow has node.I checked that the main guards are covered by changing each one and seeing a test fail.
Where the tags come from
As the issue says, the platform tags come from wheelgap's
targets.py, in the release that made the scan. So the tracker has no copy of the tag lists to drift, and both sides use wheelgap's lists, as the site says. This checks which wheels wheelgap finds in each release (abi3, per-Python and free-threaded builds, sdists), not the tag lists themselves. wheelgap's weekly accuracy check (wheelgap/wheelgap#252) covers those, deliberately with tags written out independently from AGENTS.md.Known difference: pip is asked about
NAME==VERSION, which lets it take a yanked wheel when nothing else fits (PEP 592). The scan looked the release up unpinned and skipped yanked files. A release whose only fitting wheel is yanked would therefore show up as a mismatch, with the file named.Verification
A local default run against the committed
coverage.json, with the scan's own wheelgap (0.7.0) and pip 26.3: 800 of 800 checks agree, and 144 of 144 for the 36 packages without a pure-Python wheel, with 0 mismatches, 0 skipped and 0 errors. It took 4 min 49 s with 8 workers, within the 15-minute step timeout;-vvmakes pip slower than the first version's plain downloads (2 min 24 s).scripts/check_agreement.pyaccepts the file it wrote. With wheelgap 0.9.0 installed instead, the script refuses to run (exit 2).With real pip, a dead
HTTPS_PROXYand a 404 index both come out as errors, not "no wheel". The same classification code was checked on the wheelgap side.uvx --python 3.14 [email protected](189 passed),python3 scripts/check_notes.pyandnode --check site/app.jsall pass.For the maintainer
coverage.jsonstill says wheelgap 0.7.0 whilescan.ymlpins 0.9.0. The nightly run regeneratescoverage.jsonwith$WHEELGAPbeforepip-check, so the versions match there. Locally, run it with--with wheelgap==<the scan's version>..github/andscripts/changed, so this gets the closer review.🤖 Generated with Claude Code