Repository navigation
feat(check): offer wheelgap --deps command when setup.cfg or pyproject.toml names a PyPI package - #228
Merged
patrickballard merged 5 commits intoNov 22, 2026
Conversation
…t.toml names a PyPI package Closes wheelgap#221
Contributor
|
Thanks, @dev-burnern! The care over the copied command is great to see: It looks good overall. #221 is a (Review assisted by Claude.) |
….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 wheelgap#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]>
…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]>
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]>
…, 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]>
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.) |
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.
Closes #221
What this changes
site/check/check-logic.mjs:projectNameFromMetadata(filename, text)to extract a plain, valid PEP 508 package name from rootsetup.cfg([metadata] name = ..., rejectingattr:,file:, and invalid characters) orpyproject.toml([project] name = "..."), without readingsetup.py.packageCliCommand(packageName, pythons, platforms)with strict package-name validation so nothing can be injected into a copied command line.site/check/worker.mjs:setup.cfg) or only rootpyproject.toml, fetches that file and returnsprojectNamefromprojectNameFromMetadata().site/check/check.mjs:showPackageFallback(packageName): showsNo lockfile found, but this looks like the PyPI package <name>., renders theuvx wheelgap --deps <name> ...command (with a Copy command button usingcopy()), and checks../data/packages/<canonical>.jsonviaHEADto offer a link to../p/<canonical>/only when the package is in the scan.showPackageFallback()innoLockfile()and when a lonepyproject.tomlfails with a source error."Run uvx wheelgap in a checkout for anything else."sentence fromnoLockfile()when no readable input or package name is found.tests/site/check-logic.test.mjs&tests/site/check-page.test.mjs:projectNameFromMetadata()(name = httpie,attr:,file:, invalid characters,[project] name = "x", wrong sections,setup.py),packageCliCommand()validation, andnoLockfile()with and without a detectedsetup.cfgpackage name.AI tools used (if any): Antigravity (Gemini)
Checklist
node --check site/check/*.mjspassesnode --test tests/site/check-logic.test.mjs tests/site/check-page.test.mjspasses (39/39)