Skip to content

wheelgap DIR: name the requirements files beside the pyproject.toml it checks - #662

Merged
patrickballard merged 6 commits into
mainfrom
directory-mode-prefers-pinned-requirements
Nov 21, 2026
Merged

patrickballard merged 6 commits into
mainfrom
directory-mode-prefers-pinned-requirements

Conversation

@patrickballard

@patrickballard patrickballard commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

When wheelgap DIR has no root lockfile or requirements.txt, it checks the root pyproject.toml (#656). It went on doing that beside a compiled requirements file without saying a word about it. HKUDS/Vibe-Trading's note said no lockfile or requirements.txt in <repo> while a requirements-lock.txt (uv pip compile --generate-hashes) sat right there, and apache/superset has requirements/base.txt.

Which file is read doesn't change. An earlier version of this PR read a compiled, pinned file in place of pyproject.toml. Review showed that picks the wrong file on real projects: flask's and werkzeug's requirements/build.txt pin only the build tools, and a lone requirements-cuda.txt, requirements-py38.txt or requirements/documentation.txt is not what the project installs. So this PR now only says what else is there.

What changes

  • The note reads no lockfile and no file named requirements.txt in DIR, so DIR/pyproject.toml's direct dependencies were checked.
  • The note names the root's requirements files under other names as commands to run: the existing step-2 names, plus root requirements*.lock, which is named but never read. It shows the first 3 and then a count. Those that look compiled and pinned come first, one line each:
    wheelgap: note: requirements-lock.txt looks compiled and pinned: `wheelgap DIR/requirements-lock.txt` checks what it pins
    wheelgap: note: other requirements files there: `wheelgap DIR/requirements-gpu.txt` and 2 more
    
    "Looks compiled and pinned" means the file has a compiler's mark (the pip-compile or uv header, # via comments, or --hash) and every index package it lists is pinned with == or ===. It is a hint only and is never used to choose.
  • --json: each directory_inputs entry gets other_requirements, a list of {"file", "compiled"}, filled for the reason pyproject and [] otherwise. The schema and docs/output.md are updated.

Corpus

I ran sources.load_directory on all 382 corpus folders (300 fetched plus 82 rebuilt trees in fulltree_after/), with main and with this branch. 0 folders change which file is read. 5 pyproject.toml picks now name other files:

  • Vibe-Trading: 2 named, both compiled.
  • superset: 3, all compiled.
  • LlamaFactory: 27, none compiled.
  • requests and laya: 1 dev/docs file each.

Verification

  • Ran: the full suite, ruff, ruff format and mypy.

  • New tests in tests/test_directory.py:

    • the Vibe-Trading and superset shapes;
    • flask 3.0.0's requirements/build.txt (pip-compile-multi): pyproject.toml is still read and build.txt is named;
    • files that don't look compiled: unpinned, hand-pinned like LlamaFactory's xpu.txt, marked but unpinned, unreadable, and a junk JSON requirements-foo.lock;
    • the count after 3;
    • a guard that a requirements*.lock is never read and never competes with other inputs.

    I ran the new tests against main's source: every one fails there except the guard.

  • Read: the pip-compile and uv headers as they appear in the corpus files.

🤖 Generated with Claude Code

patrickballard and others added 4 commits November 21, 2026 17:51
… 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]>
…662)

The entry for the PR, now that it has a number.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review found that preferring a compiled, pinned requirements file over pyproject.toml reads the wrong file on real projects (flask's and werkzeug's requirements/build.txt, lone requirements-cuda.txt or requirements/documentation.txt), so directory mode goes back to main's choice. The note that names the other files follows in the next commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t 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]>
@patrickballard patrickballard changed the title wheelgap DIR: a compiled, fully pinned requirements file comes before pyproject.toml's ranges wheelgap DIR: name the requirements files beside the pyproject.toml it checks Nov 21, 2026
patrickballard and others added 2 commits November 21, 2026 18:32
…s-pinned-requirements

# Conflicts:
#	CHANGELOG.md
…dencies 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]>
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.

1 participant