Skip to content

Use cached gap wheel matches for the fix hint - #628

Merged
patrickballard merged 7 commits into
wheelgap:mainfrom
kunalkshah1:fix/cached-gap-wheel-hint
Nov 21, 2026
Merged

patrickballard merged 7 commits into
wheelgap:mainfrom
kunalkshah1:fix/cached-gap-wheel-hint

Conversation

@kunalkshah1

Copy link
Copy Markdown
Contributor

Closes #611

What this changes

Use the cached gap wheel list to count matching gap cells in the text and Markdown hint. Suppress the hint when the cached list covers none. Keep the general hint when the cache is missing or bypassed. The hint reads the cache through a function that cannot fetch the list.

Tests exercise a fitting wheel, a different target, a cache miss, --no-cache and --online in both output formats. The network stub fails if the hint fetches the list. Four regression cases fail against the original code.

AI tools used: Codex

Ruff formatting and lint, mypy, and full pytest on macOS with Python 3.14 (5,190 passed, 3 skipped). The Unreleased entry will be added with the PR number.

@patrickballard

Copy link
Copy Markdown
Collaborator

Thanks @kunalkshah1, this looks good overall: the hint counts the gaps the cached gap wheel list can fill, is dropped when the list fills none, and falls back to the general wording when there is no cache or it's bypassed, all without fetching anything. It touches the same code in gapwheels.py as #620, so Patrick will sort out the order between the two.

CI is green on this commit.

#611 is a help wanted issue, so Patrick will review and merge this one himself. Nothing more needed from you for now.

(Review assisted by Claude.)

…ched

wheelgap#620 removed gapwheels.look_up() and gave the cached gap wheel list a one-hour life. The hint now reads the cached list through look_up_cached(), which never fetches, so cached_list() is gone. Tests count fetches with the gap_wheels fixture and also cover: an expired or corrupt cached list (the plain line again), several filled cells, and no hint from a cached list with -q, --json, --offline, --index-url, a mirror, --no-binary or a private package. docs/output.md says the list is kept for an hour and that no line is not a statement that nothing fits.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
patrickballard added a commit to kunalkshah1/wheelgap that referenced this pull request Nov 21, 2026
…#628's

Both PRs added a paragraph at the same spot in docs/output.md, which would conflict whichever merges second.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
CHANGELOG conflict only: both bullets kept, this PR first.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@patrickballard

Copy link
Copy Markdown
Collaborator

Thanks @kunalkshah1! A counted hint from the cached list, with no request, is what #611 asked for.

#620 merged while this was open and changed the lookup under it, so we've made these changes:

  • Merged main and moved the hint onto fix(gapwheels): refresh cached list before reporting none fit (resolves #612) #620's look_up_cached(), which cannot fetch and respects the one-hour limit.
  • The tests now count fetches through the gap_wheels fixture, so "no request without --fix" is really checked.
  • New tests for every case where a cached list must not produce a hint (-q, --json, --offline, --index-url, a mirror, --no-binary, a private-index package), and for an expired or corrupt list.
  • The docs say the list lasts an hour and that no hint is not a claim that nothing fits.

It'll merge once a final review passes.

(Review assisted by Claude.)

patrickballard and others added 3 commits November 21, 2026 11:13
CHANGELOG.md conflicted with wheelgap#622's bullet: both kept, this PR's first.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…13.0

The counted hint counts the gap cells the cached list fills, not packages, so it now ends 'for N of these gaps.' docs/output.md implied the plain hint is in 0.13.0; it and the front-page sample note now say the whole line is after 0.13.0.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@patrickballard
patrickballard merged commit 44759c7 into wheelgap:main Nov 21, 2026
13 checks passed
patrickballard added a commit that referenced this pull request Nov 21, 2026
* Report Dockerfile RUN provenance for installed requirements

* Credit PR 630 in the changelog

* docs: move the --dockerfile-inputs header paragraph clear of #628's

Both PRs added a paragraph at the same spot in docs/output.md, which would conflict whichever merges second.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

* dockerfile_inputs: give file relative to the build context, with /

The file value was the path as wheelgap joined it, so it changed with the working directory, with how --dockerfile-context was given (absolute or not) and with the OS's separator. It is now the path the Dockerfile's COPY names: relative to the build context, with /. The schema describes the three keys.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

---------

Co-authored-by: Kunal Shah <[email protected]>
Co-authored-by: Patrick Ballard <[email protected]>
Co-authored-by: Claude Fable 5.2 <[email protected]>
patrickballard added a commit to kunalkshah1/wheelgap that referenced this pull request Nov 21, 2026
@patrickballard

Copy link
Copy Markdown
Collaborator

Merged, thanks @kunalkshah1! The hint now uses the cached list and never makes a request. The final review added two things: the counted line reads "of these gaps", since it counts gaps and not packages, and the docs no longer say the hint is in 0.13.0.

(Reply 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.

"Run with --fix" hint: use the cached gap wheel list, so the hint doesn't send people to an index that has nothing for them

2 participants