Repository navigation
check: read the index settings beside a looked-up file, and keep it private without them - #235
Merged
Merged
Conversation
patrickballard
force-pushed
the
checker-reads-nearby-index-config
branch
from
November 22, 2026 12:11
1805ac1 to
80312db
Compare
…rivate without them wheelgap 0.13.0 calls a requirements file, pyproject.toml or Pipfile.lock PyPI-only only if no uv.toml, pyproject.toml or pdm.toml in its folder or a folder above it (up to the repo root) names another index. The browser never fetched those files, and dropOtherProjects() deleted any pyproject.toml it had, so requirements.txt beside a pyproject.toml with [[tool.uv.index]] was looked up on pypi.org, private names included. The worker now fetches the ones the repo has there before the check and keeps them for it; a listed one that fails to fetch, or a truncated tree, keeps the file private and the page says why. Co-Authored-By: Claude Opus 5.5 <[email protected]>
patrickballard
force-pushed
the
checker-reads-nearby-index-config
branch
from
November 22, 2026 12:13
80312db to
463a84a
Compare
3 tasks done
Brings in #231 and #225. The import lists conflicted; #225's badge test now passes privateText to renderVerdict, which calls it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the file private loadLab() fetched ../data/packages/<name>.json for every gap row, so a package a uv.lock, poetry.lock or pylock.toml pins to a private index had its name requested from the tracker's pages. It now asks only for rows check() marked as PyPI packages (row.lookup), the rule renderTable and fixLinks already use. A settings file named in another case (Pyproject.toml) is read by wheelgap on a macOS or Windows checkout but never on the browser's disk, so it now counts as unread and the file stays private. The drift test also pins the walk (the folder and its parents, up to a .git). Co-Authored-By: Claude Opus 5.5 <[email protected]>
patrickballard
added a commit
to dev-burnern/tracker
that referenced
this pull request
Nov 22, 2026
Resolved with wheelgap#235 as its reviewer set out. Main's CONFIG_NAMES, plan() configs (any case), configs_for, configsJson, fetchConfigs, dropOtherProjects(py, repo, keep) and the truncated-tree null replace wheelgap#233's own; worker.mjs is now main's. check() uses main's _reads_offline. _public_extra_hosts() now starts with _unread_configs(), since _private() returns before it reads source.pypi_only for a file taken as public and would otherwise skip wheelgap#235's fail-closed check; it still refuses any settings file listed beside or above the file, read or not; its docstring no longer says the browser doesn't fetch them. The reader-based advice moved into privateText()'s names-an-index branch, so unread or unknown settings keep their own text; renderTable's Fix text shows an unknown row's reason. Tests: main's harnesses taken, wheelgap#233's tests kept with the renderVerdict harness given privateText, privatePyprojectReason and cliCommand, plus driver tests that an extra-index file is never looked up when a nearby settings file couldn't be fetched, the list is unknown or a read one sits beside it, and privateText's reader cases. Co-Authored-By: Claude Opus 5.5 <[email protected]>
patrickballard
added a commit
to dev-burnern/tracker
that referenced
this pull request
Nov 22, 2026
…a plain uvx wheelgap for withheld names
pip shlex-splits an option line and expands ${VAR} in it, but wheelgap 0.13.0's collector splits on whitespace. So -'i' URL, --"index-url" URL, --ext\\ra-index-url URL, --no-ind''ex and -${OPT} URL are index options to pip (checked with pip 25.3's own parser), but the collector misses them, and the PyTorch line beside one made the file public. Now any option line in the file or its includes with a quote, a backslash or a $ keeps it private. The 'uvx wheelgap FILE in a checkout checks them on PyPI's files' advice is gone too: wheelgap's CLI looks a requirements file's packages up on PyPI unless --index-url names another index, so following it would send the withheld names there. The names-an-index branch is main's --index-url sentence again, and the unread and unknown branches (wheelgap#235) now say to pass --index-url with the project's index, and why.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
patrickballard
added a commit
that referenced
this pull request
Nov 22, 2026
…s PyTorch's index (#233) * fix(check): check PyPI packages when requirements use PyTorch --extra-index-url Closes #219 * Extra index: read option lines with wheelgap's own reader and fail closed _public_extra_indexes() matched exact flag names, so lines pip and wheelgap 0.13.0 read as another index (-ihttps://corp, -f./wheels, --index URL, --extra URL, --no-i), includes it didn't follow (-rcorp.txt, --requirem corp.txt) and a first-line option behind a byte-order mark left the file public, and its names went to pypi.org. It now takes the lines sources._read_requirements() collects as index options (the file and its includes, utf-8-sig, pip's line joining and abbreviations) and accepts only a whole '--extra-index-url URL' line on a listed https host with a plain path; anything else, or any error, keeps the file private. Checked against pip 25.3's own requirements parser on the same files. The browser never fetches a uv.toml, pyproject.toml or pdm.toml beside the file, so plan() now lists them and the worker passes the list: one in the file's folder or above, or no list, keeps it private too. A row's reason is now its Fix text and is named in the alert, and the 'uvx wheelgap FILE checks PyPI's files' advice is kept to requirements files and pyproject.toml (the CLI skips a Pipfile.lock's or pixi.lock's pinned index too). Co-Authored-By: Claude Opus 5.5 <[email protected]> * Extra index: no settings-file list from a truncated tree When GitHub truncates the tree, plan()'s configs can miss a root uv.toml or pyproject.toml, so an --extra-index-url file could be taken as public. The worker now passes null then, which the driver treats as uncertain and keeps the file private. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Extra index: refuse option lines pip reads differently; never advise a plain uvx wheelgap for withheld names pip shlex-splits an option line and expands ${VAR} in it, but wheelgap 0.13.0's collector splits on whitespace. So -'i' URL, --"index-url" URL, --ext\\ra-index-url URL, --no-ind''ex and -${OPT} URL are index options to pip (checked with pip 25.3's own parser), but the collector misses them, and the PyTorch line beside one made the file public. Now any option line in the file or its includes with a quote, a backslash or a $ keeps it private. The 'uvx wheelgap FILE in a checkout checks them on PyPI's files' advice is gone too: wheelgap's CLI looks a requirements file's packages up on PyPI unless --index-url names another index, so following it would send the withheld names there. The names-an-index branch is main's --index-url sentence again, and the unread and unknown branches (#235) now say to pass --index-url with the project's index, and why. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Patrick Ballard <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
The bug
wheelgap 0.13.0 counts a requirements file, a
pyproject.tomlor aPipfile.lockas PyPI-only partly from files on disk:sources._nearby_config_names_an_indexreads everyuv.toml,pyproject.tomlandpdm.tomlin the file's folder and each folder above it, up to the first one with a.git. One that names an index ([[tool.uv.index]],[tool.uv] index-url/sources/find-links/no-index,[tool.uv.pip], Poetry or PDM sources, pixi'spypi-options, apdm.toml[pypi]), or one it can't parse, means the file isn't PyPI-only. The browser never fetched those files, anddropOtherProjects()deleted anypyproject.tomlit had fetched. Sorequirements.txtwithcorp-secret-lib==1.0next to apyproject.tomlnaming a private index came outpypi_only Truein the browser (False on a real disk), and the private name was looked up on pypi.org. On main this happens with no click:plan()puts a rootrequirements.txtbefore the rootpyproject.toml, anduv exportwrites no index lines.The fix (fails closed)
driver.pyplan()returnsconfigs, everyuv.toml/pyproject.toml/pdm.tomlin the tree.configs_for(path, configs)returns the ones wheelgap would read for a file: those in its folder or a folder above it. It returns nothing for a file whose reader doesn't call_nearby_config_names_an_index(offline lockfiles,pixi.lock).needs()andcheck()take that list asconfigs_json. If a listed nearby config isn't on disk (its fetch failed), or there's no list (a truncated tree, or a caller that didn't pass one), the file is treated as not PyPI-only. Nothing in it is looked up, and the result says why:configs_unreadorconfigs_unknown, withconfigslisting the files that were read.worker.mjsfetchConfigs()fetches the filesconfigs_fornames. A failed fetch is left off disk, so the driver keeps the file private.dropOtherProjects(py, repo, keep)now keeps the file being checked and its own settings files. It removes every other fetchedpyproject.toml/uv.toml/pdm.toml, so it still does its job: each file reads as it would if it were checked first, and auv.lockchecked after arequirements.txtstill never sees thepyproject.tomlthat check fetched.repo.configstonull.load()creates an empty.gitfolder at the repo's root in Pyodide's filesystem, so wheelgap's walk up stops there, as it does in a checkout.check.mjs/check-logic.mjs: the "Not checked" alert now comes from a pureprivateText(r). It names the settings files read, or says which one couldn't be fetched, or that GitHub cut the file list short. Apyproject.tomlthat is all private only for that reason still falls back as in Repo checker: fall back from an all-private pyproject.toml #223 (to an offline lock, or a file outside its folder).privatePyprojectReasonnow gives that reason instead of "its index or source settings don't identify which packages are from PyPI".A second leak, already on main:
loadLab()fetched../data/packages/<name>.jsonfor every gap row. A package that auv.lock,poetry.lockorpylock.tomlpins to a private index therefore had its name requested from the tracker's own pages. It now asks only for rows thatcheck()marked as PyPI packages (row.lookup). That is the same rule Repo checker: link tracker page and issue tracker for dead-end fixes (#214) #231'srenderTableandfixLinksalready use, so such rows also get no PyPI link.Settings files named in another case (
Pyproject.toml,UV.TOML) are now inconfigs. wheelgap reads them on a case-insensitive disk such as a macOS or Windows checkout, but never on the browser's disk. So they're never fetched, they count as unread, and the file stays private.Keeping a nearby
pyproject.tomldoesn't change which file is checked.check()still readslockfiledirectly, and a test covers this:lockfile,listedand the rows still come fromrequirements.txt. For a requirements file, apyproject.tomlor aPipfile.lock, wheelgap reads nothing else near the input.Tests
tests/test_check_driver.py:requirements.txtplus apyproject.tomlwith[[tool.uv.index]]is private and nothing is looked up.pyproject.toml/uv.toml/pdm.tomlaboveapp/requirements.txt,app/pyproject.tomlandapp/Pipfile.lock.uv.tomlin a folder above the file is read. One in a folder that isn't above it is neither read nor fetched.CONFIG_NAMES, the readers that call the function, the worker's list, and the walk itself (the folder and its parents, stopping at a.git) must match the pinned release, so these tests fail when the pin moves and the release reads other files.Pyproject.tomlbeside the file keeps it private.tests/test_check_parity.py: the driver gets the same list, so the CLI parity cases still match.tests/site/check-page.test.mjs: the worker fetches the nearby configs, keeps them, drops another check's, and hands the driver the list. A failed fetch isn't written and is retried on the next check. A truncated tree is handed over as"null".tests/site/check-page.test.mjsalso checks thatloadLab()requests nothing for a private gap row, and feat(check): offer README badge in clean verdict and add plain-text share button #225's badge test now passesprivateTexttorenderVerdict.tests/site/check-logic.test.mjs: theprivateTextwording, andunreadableReasonfor an all-privatepyproject.tomlwhose settings couldn't all be read.On top of main at b45adad (after #231 and #225), brought in by a merge commit. I ran every command in the README's Tests section locally, all green, with the pinned wheelgap 0.13.0 for the driver and parity tests. Not tried end to end in a browser against a live repo.
Not in this PR
pip.conf/pip.iniin the repo are not made a reason to keep a file private. wheelgap 0.13.0 doesn't read them: the function's docstring says user and system settings aren't read, and a test asserts they aren't in_CONFIG_FILES. pip doesn't read a repo-localpip.confunlessPIP_CONFIG_FILEpoints to it. That's a follow-up if wheelgap ever starts reading them.With #233
#233 adds the same
configskey toplan()and the sameconfigs_jsonparameter toneeds()/check(), with the same meaning, includingnullmeaning unknown. Merged on top, the two should fit together._public_extra_hostscan keep its own check that no listed config is nearby, which is stricter and safe. It can also drop that check and rely on this PR's_unread_configsplus_nearby_config_names_an_index, since the files are now on disk.🤖 Generated with Claude Code