Skip to content

Record which packages gained or lost a wheel each night - #23

Merged
patrickballard merged 3 commits into
wheelgap:mainfrom
sarankumar1325:data/changes-json
Nov 11, 2026
Merged

patrickballard merged 3 commits into
wheelgap:mainfrom
sarankumar1325:data/changes-json

Conversation

@sarankumar1325

Copy link
Copy Markdown
Contributor

Closes #18

What this changes

scripts/update_changes.py previous.json data/coverage.json data/changes.json compares the scan before and after and appends that day's entry to data/changes.json:

[{"date": "2026-11-10", "gained": [{"name": "ciso8601", "version": "2.4.1", "target": "3.13 win-arm64", "from": "source", "to": "wheel"}], "lost": [{"name": "cua-driver", "version": "0.46.1", "target": "3.13 win-amd64", "from": "wheel", "to": "missing"}]}]
  • Only changes to or from wheel are listed. If either side is unknown, the cell is skipped, so a lookup error doesn't show up as a lost wheel and then a regained one. Packages or targets that are only in one of the two scans (top-5,000 churn, a wheelgap bump adding targets) are skipped too. Targets are matched by label, not position.
  • version is the version in the new scan. Items are in rank order, then target order.
  • If a second scan runs the same day (a manual workflow_dispatch), it's folded into that day's entry: each cell keeps the first scan's from and takes the latest to, so a wheel lost and regained the same day drops out. Without this, the second run would overwrite the first run's changes, because by then previous.json is the same-day scan.
  • Entries older than 90 days (by the scan's date) are dropped.
  • If there's no previous.json, it writes the file unchanged (or []). This PR also commits data/changes.json as [], so the file exists before the first nightly run.

scan.yml: the scan job copies data/coverage.json to previous.json before the scan (not committed or uploaded), runs the script after update_history.py, and adds data/changes.json to the artifact. The commit job adds it to git add. The publish job already copies data/*.json to the site. The README describes the file under "Using the data".

Checked (there's no test setup yet, #16):

  • On the real data: the 2026-11-09 scan (7a6202e^) against the committed 2026-11-10 scan gives 22 gained and 11 lost. I spot-checked ciso8601 (source to wheel on win-arm64) and cua-driver (wheel to missing on Windows). Running it twice gives the same file.
  • On made-up scans: unknown on either side skipped; a package missing from either scan skipped; reordered and added targets matched by label; a same-day loss and regain gives an empty entry; entries 90 or more days old dropped; no previous.json gives [].
  • Parsed scan.yml and data/changes.json. ruff check is clean.

AI tools used (if any): An AI assistant helped write the script. I reviewed the diff and ran it on the real scan data.

scripts/update_changes.py compares the previous data/coverage.json
(copied aside before the scan) with the new one and appends that day's
gained/lost wheels to data/changes.json, keeping 90 days. Only changes
to or from wheel count; unknown cells, and packages or targets only in
one scan, are skipped. A second scan on the same day is folded into
that day's entry. scan.yml runs it after the history update, uploads
it and commits it with the other data.
@patrickballard

Copy link
Copy Markdown
Contributor

Thanks, @sarankumar1325! This looks good overall: skipping unknown cells so a flaky lookup doesn't read as a lost wheel, and folding a same-day rerun into that day's entry, are both careful touches.

Because it changes the nightly scan workflow, scripts/ and data/, Patrick will review and merge this one himself, so it may take a little longer than usual. Nothing is needed from you in the meantime.

(Review assisted by Claude.)

patrickballard and others added 2 commits November 11, 2026 02:20
Moving the scan to a new wheelgap release (as in wheelgap#9 and wheelgap#11) changes
results because wheelgap changed, not the packages; recording those
would list hundreds of wheels as gained or lost.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard

Copy link
Copy Markdown
Contributor

Merged, thanks @sarankumar1325! The diff logic holds up on real scans: the independent review re-derived the last two nights by hand and got your 22 gained and 11 lost.

I pushed two small changes first:

  • wheelgap version changes: a night whose scan used a different wheelgap version is now skipped. Moving the scan to a new release (as in Scan with wheelgap 0.6.3: add Python 3.15 and 3.15t #9 and Scan with wheelgap 0.7.0 #11) changes results because wheelgap changed, not the packages, and would otherwise list hundreds of wheels as gained or lost.
  • Workflow safety: the changes step has continue-on-error: true, so if it ever fails, the night's coverage and history still get committed. The README now also says that packages entering or leaving the top 5,000 aren't listed.

If you'd like another one, #19 (cross-check the scan against pip and publish the agreement rate) is open and unclaimed. It fits well with the new "find a real bug" recipe in wheelgap's AGENTS.md.

(Review assisted by Claude.)

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.

Record which packages gained or lost a wheel each night

2 participants