Skip to content

Repo checker: check requirements files, pyproject.toml and Pipfile.lock too, looking packages up on PyPI from the browser #186

Closed

Description

@patrickballard

The repo checker reads only lockfiles that list every package's files (OFFLINE in site/check/driver.py). For anything else, it sends people away:

Plenty of apps and most libraries have exactly those files and no lockfile, so they're turned away before they've seen a single gap, and never reach the fixes. The CLI checks all of them by looking each package up on PyPI, and the browser can make those lookups too. The worker already fetches https://pypi.org/pypi/<name>/json for --suggest's fixes (fixes() in site/check/worker.mjs), and pypi.org is already in the page's connect-src. What's missing is a driver step that fills the packages from answers the worker fetched. wheelgap's own pypi.fill_all() can't do it in Pyodide: it uses urllib and a thread pool.

What to do

  • driver.plan(): also list pyproject.toml files, after the lockfiles in the same folder, so a uv.lock next to one is still picked first. Mark them as needing lookups.
  • Add a driver step, say needs(root, path, options_json). It runs sources.load_file() on the file and returns the lookups wheelgap's pypi.fill() would make. That's each package that isn't skipped and has no files (or has partial_files, as in pixi), with its canonical name and its pinned version or null. Return only names wheelgap would send to PyPI (pypi.may_look_up(p.registry, None)). Then a package from another index (a requirements file's --index-url, a Pipfile.lock source) never reaches pypi.org, and is skipped as private index, as the CLI does.
  • Requirements includes (-r, -c): load_file() reads them from disk, so the worker has to fetch them first, from the same repo and ref. The tree is already loaded, so it knows the paths. Fetch at most a handful. An include that's a URL, or outside the repo, is an error naming it.
  • Worker: fetch https://pypi.org/pypi/<name>/<version>/json for a pinned package and https://pypi.org/pypi/<name>/json for a range, as pypi.fill() does. Run 6 at a time, as fixes() does, up to a cap (say 300), and say how many weren't looked up. Those count as unknown, never as a gap. Keep the project JSON in the releases cache, since fixes() uses the same document.
  • driver.check() for these inputs: fill each package from the fetched JSON the way pypi.fill() does: pypi._resolve_pythons(pkg, pythons, lambda p, py: pypi._fill_json_data(p, data, py, base), python), so a range resolves per Python as in the CLI. Mark a failed or missing lookup as an error so it shows unknown. Then build the rows from check.check([source], targets). In 0.13.0, api._check_lockfile refuses a pyproject.toml without deps=True and calls fill_all itself, so this path can't go through it. Return the same JSON shape check() returns now, so the table, the fixes and the prompt need no new code.
  • Copy: in the verdict detail, say that a requirements file or pyproject.toml is checked for its direct requirements, as uvx wheelgap requirements.txt does, and that --deps on the command line checks the whole tree. Update noLockfile() and needsIndex() for what's left: a repo with none of these files, and lookups over the cap.
  • Not in this issue: --deps (resolving the whole tree), and PEP 723 scripts (wheelgap script.py ships in the next wheelgap release).

Done when:

  • For a public repo that has only a requirements.txt, and one that has only a pyproject.toml (name both in the PR), the page lists the gaps, and the uvx wheelgap … -p … -t … command it gives prints the same ones.
  • A Pipfile.lock and a pixi.lock are checked the same way, each package for its pinned version.
  • With a requirements file whose first line is --index-url https://example.invalid/simple, no request goes to pypi.org (check the browser's Network tab), and its packages are listed as skipped.
  • tests/test_check_driver.py feeds needs() and check() canned PyPI JSON for: a pinned package, a range that resolves to different releases on two Pythons, a 404 (unknown), a private-index package (needs() doesn't list it), a -r include, and a pyproject.toml.
  • A lockfile that lists its files makes the same requests as today: none to PyPI before the fixes.

Activity

  1. added
    enhancement
    help wanted
    high impact
    on Nov 20, 2026
  2. added a commit that references this issue on Nov 20, 2026
    090bee5
  3. added a commit that references this issue on Nov 23, 2026
    18f121e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhelp wantedhigh impact

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions