Repository navigation
wheelgap DIR finds the project's input when the root has no lockfile: pyproject.toml, other requirements names, subfolders - #656
Merged
Conversation
Run on the 300 most-starred Python repos, wheelgap DIR answered for 172 and said 'no lockfile found' for 124 that had inputs: a pyproject.toml with [project] dependencies (41), requirements files under other names (12), inputs only in subfolders (52). And it stopped at a root file with nothing to check (4). Directory mode now goes on to the root's pyproject.toml, then its one requirements file under another name, then the one input in a subfolder, with a note and a --json directory_inputs entry saying which file was read. It never picks one of several: those are listed as commands, exit 2. A root file with nothing to check gives way to the next one that has something. Directories that already had an answer are read as before; check_lockfile() and wheelgap diff are unchanged. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The tools join the CLI's error lines with '; ', which turned the new list of candidate files into 'Check one:; wheelgap a; wheelgap b'. An indented line now stays a line of its own. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The bullet needs the number the PR got. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The list in inputs.md was a paraphrase of _SIDE_WORDS; a reader deciding how to name a folder needs the real one, and how a word is matched. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…en a rival requirements file exists Review of #656. A subfolder pick was labelled as a bare requirements.txt in the header, --markdown and --json's sources, which reads as the root's once stderr is gone (a job summary). And it was picked although another requirements file could as well be the project's: one under another name beside it (frigate's docker/main/requirements-wheels.txt) or a dev-named one at the root. Also: the picked subfolder is read as wheelgap FOLDER reads it (an empty requirements.txt gives way to its pyproject.toml), a folder that can't be read means nothing is picked, README.txt and the like in requirements/ aren't requirements files, and a picked file that isn't UTF-8 is named in the error. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This was referenced Nov 21, 2026
patrickballard
added a commit
that referenced
this pull request
Nov 21, 2026
…t checks (#662) * wheelgap DIR: a compiled, fully pinned requirements file comes before pyproject.toml's ranges #656 made wheelgap DIR read the root pyproject.toml before any requirements file under another name. In HKUDS/Vibe-Trading (requirements-lock.txt, uv pip compile with hashes) and apache/superset (requirements/base.txt, uv pip compile) that checked the ranges at their newest releases instead of what gets installed, and the note said there was no lockfile or requirements.txt. Now the one compiled (header, # via or --hash) and fully pinned (every package == or ===) file under another name is read instead, with a note saying why; several are listed with pyproject.toml (exit 2). Other files leave pyproject.toml first, and the note names them. requirements*.lock at the root counts as a requirements file under another name. Co-Authored-By: Claude Opus 5.5 <[email protected]> * CHANGELOG: wheelgap DIR prefers a compiled, pinned requirements file (#662) The entry for the PR, now that it has a number. Co-Authored-By: Claude Opus 5.5 <[email protected]> * wheelgap DIR: name the requirements files beside the pyproject.toml it checks When directory mode checks the root pyproject.toml, the note now says its direct dependencies were checked and names the root's requirements files under other names as commands (the first 3, then a count), those that look like pip-compile / uv pip compile / uv export output with every package pinned first ('requirements-lock.txt looks compiled and pinned: wheelgap ... checks what it pins'). Before, Vibe-Trading's note said 'no lockfile or requirements.txt' beside a requirements-lock.txt. The look is a hint only: which file is read is main's. --json's directory_inputs gets other_requirements with a compiled flag, in the schema and docs/output.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Directory mode hint: read only the file itself, and don't claim dependencies a pyproject.toml lacks Review found that the compiled-file hint opened every requirements file beside pyproject.toml and followed its -r/-c, so a -r /dev/zero ran out of memory and a FIFO include hung, all for a hint; and that the note said direct dependencies were checked when the pyproject.toml listed none. The hint now skips files over 2 MB and any file with -r/-c, and the note says pyproject.toml was checked. Co-Authored-By: Claude Opus 5.5 <[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.
Why
We ran
wheelgap <repo dir>(whatuvx wheelgapin a checkout does) on the 300 most-starred Python repos. It answered for 172 (57%). 124 got "no lockfile found" although the project had something to check: apyproject.tomlwith[project] dependenciesand no lockfile (41), requirements files under another name (12), inputs only in subfolders (52). In 4 more, directory mode stopped at a root file with nothing in it (arequirements.txtthat only says., a conda-onlypixi.lock, an emptyuv.lock) and printed "No packages to check" beside apyproject.tomlor lockfile that had the answer.What changes
wheelgap DIR(and plainwheelgap) still reads the first ofuv.lock,pylock.toml,poetry.lock,pdm.lock,Pipfile.lock,requirements.txt,requirements.lock,pixi.lockat the root, in that order. Every directory that had an answer before gets the same one from the same file (checked on all 172). New, each step only if the one before found nothing:pyproject.toml, if it has a[project]table with dependencies or extras: checked exactly aswheelgap DIR/pyproject.toml(same code path, same "lists direct dependencies only … add--deps" note), plus a note that says there was no lockfile.requirements*.txt/.inat the root,*.txt/.ininrequirements/(notconstraints*; not a.inbeside its compiled.txt). Exactly one: checked. Several: exit 2 with each as a command to run. wheelgap never picks one of several.wheelgap FOLDERwould read (first lockfile name, else apyproject.tomlwith[project]dependencies). Not searched: hidden folders,node_modules,site-packages,__pycache__, virtualenvs (pyvenv.cfg); symlinks aren't followed; at most 2000 folders are opened (a cut-short search never picks). Exactly one: checked. Several: listed (first 10, then a count), exit 2.pyproject.toml, with a note naming the file passed over and why. If nothing better exists the run is exactly as before (exit 0, "No packages to check", no new note). With--environmentthepixi.lockis read whatever it holds.no lockfile found in DIRstart, says what was looked for, and gives the reason apyproject.tomlcouldn't be checked instead of a command that would only repeat that error.A note on stderr says which file was read whenever it isn't the root lockfile (printed with
--quiettoo, like the direct-dependencies note).--jsongets a top-leveldirectory_inputslist (directory,file,reason:lockfile/pyproject/requirements/subfolder, andempty: the files passed over, with why);sourcesis unchanged. The "pick one" error is aDirectoryChoiceError(aSourceError) and its--jsonerror object also hascandidates.Where I was stricter than "exactly one: check it"
The brief for this change was "never give an answer from a file a human wouldn't call the project's dependencies". Three cases are therefore listed as a command (exit 2) instead of checked, even when there is only one candidate:
dev,test(s),doc(s),example(s),sample(s),demo(s),bench(mark),lint,ci,typing,fixturesortemplatesas a word (requirements-dev.txt,docs/requirements.txt,e2e_tests/uv.lock). Such folders only count when no other subfolder has an input;setup.py,setup.cfg, or apyproject.tomlwith[project],[build-system]or Poetry dependencies): the project's dependencies are at the root where wheelgap couldn't read any, sotools/requirements.txtisn't them;On the full trees this holds back 9 repos that have exactly one such candidate (e.g. huggingface/transformers
benchmark_v2/requirements.txt, python/cpythonDoc/pylock.toml, opendatalab/MinerUdocs/requirements.txt, threerequirements-dev.txt/-docs.txt). Open question: check those too, with the note? It would add up to 9 answered; I kept them out because a green run fromdocs/requirements.txtreads as "the project is fine".No "main file" guess (
requirements/base.txt,default.txt,prod*.txt): in the corpus the several-files cases are vllm (common/cpu/cuda/…), faceswap (_requirements_baseplus one per GPU vendor), DeepSpeed, celery (default.txtamong 10), ColossalAI, Fooocus (requirements_docker.txt,requirements_versions.txt), academic-research-skills.base/commonthere is what every variant includes, not what anyone installs, and the answer differs per variant (that is the point of the split), so the list is the honest output. A rule could be added later for a name the maintainers decide is safe.A
pyproject.tomlwhose[project]table lists no dependencies and no extras is now the answer (No packages to check., exit 0, aswheelgap DIR/pyproject.tomlgives) unless the root has one requirements file that isn't dev/docs-named (then that is checked, with a note: Stability-AI/generative-models →requirements/pt2.txt) or subfolders have inputs (then they are listed). Before, such a directory was exit 2.Other entry points
--dockerfile X DIRand no input at all (.): same code (load_inputs), so the same search; one test.check_lockfile/check_dockerfile: they run the CLI, so the same search; the note is innotes.mcp.pychange: an indented error line stays on its own line instead of being joined with;, so the candidate list is readable.check_dockerfilestill adds "(pass 'path' …)" to the nothing-found error, which keeps its wording.check_lockfile()andwheelgap diff: unchanged on purpose. They have no notes to say which file was picked, so they keepfind_lockfile(root lockfile by name, old message). Documented.scan.py: doesn't take directories.Corpus, before and after
Check A of the corpus (
wheelgap <repo> -p 3.13,3.15 -t linux-x86_64,linux-aarch64,macos-arm64,win-amd64 --json, classified asrun_checks.pydoes) on all 300 folders:The corpus folders hold the root files plus at most 3 nested files per repo, so "as fetched" overstates the single-subfolder case (langchain-ai/langgraph has 9 nested
uv.lock, the corpus has 1). For the third row I rebuilt the 83 repos not answered from a root lockfile orpyproject.tomlfrom their git trees at the corpus commits: every lockfile-named file andpyproject.tomldown to depth 3, rootrequirements*andrequirements/*(lockfile-named files as empty placeholders, except the one a run would read, fetched; nestedpyproject.tomlfetched, since the search reads them). What that still doesn't cover: PostHog's tree is truncated by the API (its root files are missing from the corpus, so its row is wrong either way), symlinked inputs were left out, and the folder cap never triggers on a tree rebuilt this way.Where the 233 come from: 172 root lockfile as before, 41 root
pyproject.toml, 4 after an empty root file (TradingAgents and pandas →pyproject.toml, textual →poetry.lock, claude-seo →requirements.txt), 2 a single other-named requirements file, 14 a single subfolder input. Listed (48): 27 several subfolders, 7 several requirements files, 11 dev/tests/docs only, 3 a subfolderrequirements.txtwith a rival beside it (frigate, Resume-Matcherrequirements-lock.txt, cleanyourtv). Nothing found (15):setup.pyonly, Poetry without a lock,environment.ymlonly, haystack'sexclude-newerduration.Answers a human might not call "the project's dependencies"
All 14 single-subfolder answers, judged by hand. Fine: 666ghj/MiroFish
backend/uv.lock, abi/screenshot-to-codebackend/poetry.lock, deepseek-ai/DeepSeek-V3inference/requirements.txt, mouredev/Hello-PythonBackend/FastAPI/requirements.txt, agentskills/agentskillsskills-ref/uv.lock, 0xAX/linux-insidesscripts/uv.lock, Asabeneh/30-Days-Of-Pythonpython_for_web/requirements.txt. The repo's only Python, in a helper folder of a non-Python repo (true, but thin): public-apisscripts/requirements.txt, awesome-machine-learningscripts/requirements.txt, HelloGitHubscript/github_bot/requirements.txt, claude-howtoscripts/requirements.txt, anthropics/knowledge-work-pluginsbio-research/skills/instrument-data-to-allotrope/requirements.txt. Doubtful: QwenLM/Qwen3 →eval/requirements.txt, apachecn/ailearning →old/requirements.txt. I triedevalandoldas "side" words and took them out again: wshobson/agents hasplugins/plugin-eval/uv.lock, a plugin named eval, and dropping it left one candidate that was then picked. Every word in that list can do this, which is why the list is short.After review (f233cbb)
scripts/requirements.txt) in the header,--markdownand--json'ssources; a file passed by name keeps its bare name.requirements.txtis listed, not picked, when another requirements file could as well be the project's: one under another name beside it (frigate'sdocker/main/requirements-wheels.txt; dev/docs-named ones and constraints don't count) or a dev-named one at the root.wheelgap FOLDERreads it, so arequirements.txtwith nothing to check gives way to that folder'spyproject.toml. (In a list of several, the command still names the folder's first file.)requirements/, names starting withreadme,license,notesand the like (the list is indocs/inputs.md) aren't requirements files.The rebuilt trees for the third row now also carry the requirements-like siblings of each picked subfolder file, so the rival rule is measured.
Verified
Run: full suite, ruff check, ruff format --check, mypy locally. Every test in
tests/test_directory.pyand the changed one intests/test_cli.pyfails on main (checked by stashingsrc/). The corpus runs above, with real PyPI lookups; the before/after comparison shows no repo answered on main changed its file or bucket. Timing by hand: a capped search of a 2000-folder tree takes 0.3 s.Read, not run: nothing here claims to match pip, uv or Docker; the search is wheelgap's own rule and the files are read by the existing readers.
Look hardest at
load_directoryinsources.py: the order of the steps and the three "listed, not checked" rules.pyproject.toml(2 → 0).--quiet.🤖 Generated with Claude Code