gallery: validate declared installable deps; add pygraphics to apollo deps; refresh requirements and tests - #122
Merged
Conversation
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.
Motivation
requirements.txtandrefresh-requirements.pyin sync with packages that publish from the audio components repo.pygraphicsas a dependency.Description
INSTALLABLE_DEPSand an AST-basedimported_top_level_moduleshelper plusvalidate_example_depsto detect missing or unused declared installable deps, and call it frommaininscripts/gallery_generator.py.astwhere needed and wire dependency validation into the discovery flow.lib/examples/apollo/apollo.pyheader comment to includepygraphicsin the# deps:line.requirements.txtordering to includepydevices-audioinstrumentsandpydevices-audioeffectsin the installation order.scripts/refresh-requirements.pyPACKAGE_ORDERwith comments and the two audio component entries so the refresh script keeps them.tests/test_gallery_screenshots.pythat exercisesvalidate_example_depsfor missing/unused-dep detection.tests/test_peterhinch_page.pyinto aunittest.TestCaseclass and make it runnable as a script with aif __name__ == "__main__": unittest.main()entry.Testing
python -m unittest tests.test_gallery_screenshotsand the new dependency checks passed.python -m unittest tests.test_peterhinch_pageand the refactored page tests passed.python -m unittest) and observed no failures for the changed files.Codex Task
Verification by the reviewer (2026-09-06)
The branch was fetched and run on the maintainer's machine beside the
pydevicessibling checkout, whichtests/test_browser_url.pyneeds.python -m unittest tests.test_peterhinch_pageRan 17 tests … OK(0 collected before this PR)python -m unittest discover -s testsRan 60 tests … OK(43 before)scripts/gallery_generator.py --check55 gallery demo(s) (47 module, 8 manifest; 5 featured; 2 in a new window); 17 local-only; three reverse-check warnings (tiny_toasters declarespalettes, touch_gui_simpletest declarespygraphics, widgets_locker_kiosk declaresaudioif; none imported)pygraphicsremoved fromlib/examples/apollo/apollo.py's# deps:header, then--checkgallery dependency errors: lib/examples/apollo/apollo.py: missing # deps: pygraphics— header restored afterwardsThe apollo header change is a real undeclared dependency the new guard found: on
mainthe file declares# deps: palettesand imports pygraphics, so the Apollo DSKY demo has been failing on the deployed gallery the same way drum_machine did before #120 was filed.The
requirements.txt/refresh-requirements.pylines in this diff are identical to whatmainalready carries in8268d3aa; the branch re-applied them on the older base, and the merge resolves them as one change.