feat(Scripts): support multi-level script groups via subfolders #2738
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.
What I did
Refactored the discovery of ape scripts to make them slightly "lazier" and adding support for "subfolder groups", which composes a
click.Groupfrom script files (and/or further subfolder groups) for a non-module pathfixes: #2735
Also tried to fix this issue w/ using
--interactivewhere a successful script doesn't actually launch the terminalfixes: #2693
How I did it
By refactoring the discovery process, we add a lot more flexibility on how we handle the
scripts/folder, allowing the potential for other types of scripts (remote or dependency scripts, non-Python scripts, etc.)Also, in theory it should now support loading scripts from a Python module, as long as that module exposes either a
mainfunction orcliclick.Command|GroupHow to verify it
Run this branch on any Ape project and see if it works
Checklist