Skip to content

feat(check): discover and prioritize additional requirements*.txt files in plan() - #229

Merged
patrickballard merged 5 commits into
wheelgap:mainfrom
dev-burnern:feat/plan-other-requirements-filenames
Nov 22, 2026
Merged

patrickballard merged 5 commits into
wheelgap:mainfrom
dev-burnern:feat/plan-other-requirements-filenames

Conversation

@dev-burnern

Copy link
Copy Markdown
Contributor

Closes #218

What this changes

  • site/check/driver.py:
    • Adds _is_extra_requirements(pp) so plan() also discovers clearly named requirements files: requirements*.txt, *-requirements.txt, *_requirements.txt, and *.txt directly inside a requirements/ folder (excluding constraints*.txt and skipped folders such as tests/).
    • Updates plan()'s sort key (_lockfile_sort_key()) to keep each folder's exact-named lockfiles and pyproject.toml first as today, followed by the extra requirements files ordered with runtime stems (default, base, main, prod, production, requirements) before alphabetical names so automatic fallback lands on requirements/default.txt rather than requirements/docs.txt.
    • All extra requirements files are marked offline: False, so needs() and check() look them up on PyPI and follow -r / -c includes just like requirements.txt.
  • tests/test_check_driver.py, tests/test_check_parity.py, & tests/site/check-logic.test.mjs:
    • Tests plan() on a Celery-like tree (pyproject.toml, requirements/default.txt, requirements/docs.txt, constraints.txt, tests/requirements.txt, requirements-dev.txt, prod-requirements.txt, and root requirements.txt first).
    • Tests needs() and check() on requirements/base.txt with a -r common.txt include.
    • Adds requirements-dev.txt to test_check_parity.py's LOOKED_UP suite to verify CLI parity.
    • Tests in check-logic.test.mjs that an auto-picked pyproject.toml with no [project] table moves on to requirements/default.txt.

AI tools used (if any): Antigravity (Gemini)

Checklist

  • pytest tests/test_check_driver.py tests/test_check_parity.py passes for all new & parity tests
  • node --test tests/site/check-logic.test.mjs passes (24/24)

@patrickballard

Copy link
Copy Markdown
Contributor

Thanks, @dev-burnern! Pulling the sort into _lockfile_sort_key() makes the order much easier to follow, and the Celery-like tree in test_plan (with constraints.txt and tests/requirements.txt left out) pins exactly the cases that matter.

It looks good overall. #218 is a help wanted issue on the checker page, so Patrick will review and merge this one himself.

(Review assisted by Claude.)

patrickballard and others added 4 commits November 22, 2026 11:19
…s name

plan() ranked them by how runtime-like a name sounds (default, base, prod first), so celery's check silently landed on requirements/default.txt, and a root requirements-dev.txt outranked a backend/uv.lock the page picked before. wheelgap never picks one of several requirements files by name (wheelgap DIR lists them; #662 there keeps it a hint). Now they're marked other and come after every exactly-named file, so the page's pick is unchanged wherever one exists; a lone one is checked; with several, autoPick() picks none and the page asks which one, with the file picker. They're matched case-sensitively and without README.txt-like names, as wheelgap reads them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…p instead of failing

With no file picked, runCheck() looked up the plan entry for a null path and threw on lock.offline when a platform or Python chip was clicked in the chooser. It now redraws the setup with the new selection and waits for a file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…offered, not checked

autoPick() checked a lone requirements file under another name whatever its name, so requirements-dev.txt or requirements/test.txt was answered as if it held the project's dependencies. wheelgap DIR on main never checks such a file on its own (_is_side, _SIDE_WORDS in src/wheelgap/sources.py; the word list is copied from there). Now the page offers it with the chooser, which shows its picker even for one file, with wording for that case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolved with wheelgap#226 and wheelgap#223 as the second review set out. plan() entries are {path, offline: _reads_offline(p)} with other: True for requirements files under other names. pickRequestedFile()'s own pick (no file named, or one that can't be checked) is now autoPick()'s and passes its choose through; a named or added file has choose null. onLoaded() takes wheelgap#226's picked/lockfiles/fileNotice, shows noLockfile only with neither a lock nor a choice, sets the targets, then asks with chooseFile(), which shows the fallback notice. renderSetup keeps the Choose a file option and clears fileNotice on change. The badge default is autoPick() over the files a link didn't add. wheelgap#223's private-pyproject folder filter runs before autoPick(), so covered other-named files are never offered or checked. Tests: both sides kept, harnesses given pickRequestedFile and privatePyprojectReason, pickRequestedFile results now carry choose, and new cases for these interactions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard
patrickballard merged commit ba3ef18 into wheelgap:main Nov 22, 2026
1 check passed
patrickballard added a commit to dev-burnern/tracker that referenced this pull request Nov 22, 2026
Resolved with wheelgap#226 and wheelgap#229 as the second review set out. The page state and onLoaded() take both fileInTree and projectName, and the worker returns both; onLoaded() keeps wheelgap#226's picked/fileNotice and wheelgap#229's chooser, with the targets set before the no-lockfile answer. noLockfile() puts wheelgap#226's notice first on wheelgap#228's text, without the Run uvx wheelgap sentence; showPackageFallback() shows the notice first in #alerts; onResult()'s error branch keeps wheelgap#226's notice in the status, then the package fallback. The worker reads the project name with metadataFiles() over the files that aren't wheelgap#229's other-named requirements files. chooseFile() also offers the --deps command when the repo names its package. Tests: both sides kept; wheelgap#228's harnesses given pickRequestedFile, privatePyprojectReason, autoPick and chooseFile; its status assertion matches main's capitalised Wheelgap.

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
…, then --deps

wheelgap#229's test matched the one-line alerts call that the merge's --deps addition split in two, so it failed although the notice still comes first. It now runs chooseFile() on stand-ins: a named-file notice is the first alert, the package's --deps command the second, and neither shows when there's nothing to say. Every other source-matching assertion in check-page.test.mjs was checked against the merged check.mjs, worker.mjs and index.html.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
patrickballard added a commit that referenced this pull request Nov 22, 2026
…toml names a PyPI package (#228)

* feat(check): offer wheelgap --deps command when setup.cfg or pyproject.toml names a PyPI package

Closes #221

* Package fallback: read setup.cfg beside a build-system-only pyproject.toml, and parse names as configparser and TOML do

A lone root pyproject.toml with only [build-system] (the usual setuptools layout) was the only file read for the name, so the setup.cfg's [metadata] name was never offered and the visit ended in "no [project] table", the #221 dead end. metadataFiles() now tries the pyproject.toml, then setup.cfg. The name reader also no longer takes a value continued on an indented line, a [METADATA] section, or a name under a [[tool.uv.index]] or commented header as the project's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Package fallback: refuse continued names and multi-line strings; use this repo's targets

setup.cfg: a deeper-indented line after name = httpie continues the value (configparser reads httpie\nevil), blank or comment lines in between or not; that's no plain name now. pyproject.toml: a multi-line string isn't tracked, so a name = line inside one was read as [project]'s; any triple-quoted string before the name now gives null. And onLoaded() set the Pythons and platforms only after the no-lockfile return, so the --deps command used the previous repo's; they're set first now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Chooser test: check chooseFile()'s alerts by running it, notice first, then --deps

#229's test matched the one-line alerts call that the merge's --deps addition split in two, so it failed although the notice still comes first. It now runs chooseFile() on stand-ins: a named-file notice is the first alert, the package's --deps command the second, and neither shows when there's nothing to say. Every other source-matching assertion in check-page.test.mjs was checked against the merged check.mjs, worker.mjs and index.html.

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]>
patrickballard added a commit to dev-burnern/tracker that referenced this pull request Nov 22, 2026
Resolved as the second review set out. renderVerdict() sets isClean, toggles the card, hides the README badge offer unless the result is clean with no private-index packages, then uses wheelgap#223's verdict ternary (private pyproject, every Python left out, verdictText). renderNext() keeps wheelgap#225's Keep it green condition (r.private empty) with main's badge default from wheelgap#226/wheelgap#229 untouched. The copy-share handler, with the private count that drops the ✓, sits beside main's copy-prompt handler, which passes state.lab (wheelgap#231). Imports are the union, with shareText. Tests: both sides kept; wheelgap#225's renderVerdict/renderNext harness given autoPick and privatePyprojectReason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard

Copy link
Copy Markdown
Contributor

Merged, thanks @dev-burnern! We pushed a few fixes to your branch before merging; the commits say what and why.

(Posted with help from 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.

Repo checker: a repo that keeps its requirements in requirements/default.txt or requirements-dev.txt ends in a dead end

2 participants