-
Notifications
You must be signed in to change notification settings - Fork 1
test: restructure suite and speed up CI #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,4 +60,4 @@ jobs: | |
| run: uv run python devtools/lint.py | ||
|
|
||
| - name: Run tests | ||
| run: uv run pytest | ||
| run: uv run pytest -m "not slow" | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| brainx[cpu] | ||
| brainpy[cpu] | ||
| canns-lib>=0.6.2 | ||
| tqdm | ||
| matplotlib | ||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,6 @@ dependencies: | |
| - scipy | ||
| - tqdm | ||
| - pip: | ||
| - brainx[cpu] | ||
| - brainpy[cpu] | ||
| - canns-lib>=0.6.2 | ||
| - canns | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| """Command-line entry point for the CANNs toolkit. | ||
|
|
||
| `pip/uv install canns` installs several console scripts: | ||
| - `canns`: convenience wrapper (this module) | ||
| - `canns-tui`: Textual launcher (ASA / Gallery) | ||
| - `canns-gallery`: Gallery TUI | ||
| - `canns-gui`: ASA GUI (requires `canns[gui]`) | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
| import sys | ||
| from collections.abc import Sequence | ||
|
|
||
|
|
||
| def main(argv: Sequence[str] | None = None) -> int: | ||
| parser = argparse.ArgumentParser(prog="canns", description="CANNs toolkit entry point.") | ||
| parser.add_argument( | ||
| "--version", | ||
| action="store_true", | ||
| help="Print installed CANNs version and exit.", | ||
| ) | ||
| group = parser.add_mutually_exclusive_group() | ||
| group.add_argument("--asa", action="store_true", help="Run the ASA TUI directly.") | ||
| group.add_argument("--gallery", action="store_true", help="Run the model gallery TUI directly.") | ||
| group.add_argument("--gui", action="store_true", help="Run the ASA GUI (requires canns[gui]).") | ||
|
|
||
| args = parser.parse_args(list(argv) if argv is not None else None) | ||
|
|
||
| if args.version: | ||
| try: | ||
| from importlib.metadata import version | ||
|
|
||
| print(version("canns")) | ||
| except Exception: | ||
| try: | ||
| from canns._version import __version__ | ||
|
|
||
| print(__version__) | ||
| except Exception: | ||
| print("unknown") | ||
| return 0 | ||
|
|
||
| if args.gui: | ||
| from canns.pipeline.asa_gui import main as gui_main | ||
|
|
||
| return int(gui_main()) | ||
|
|
||
| if args.gallery: | ||
| from canns.pipeline.gallery import main as gallery_main | ||
|
|
||
| gallery_main() | ||
| return 0 | ||
|
|
||
| if args.asa: | ||
| from canns.pipeline.asa import main as asa_main | ||
|
|
||
| asa_main() | ||
| return 0 | ||
|
|
||
| from canns.pipeline.launcher import main as launcher_main | ||
|
|
||
| launcher_main() | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| raise SystemExit(main(sys.argv[1:])) |
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (testing): Coverage exclude pattern for main guard looks incorrect and likely won’t match the intended line.
exclude_linesuses regex matching, so"if __name__ == .__main__.:"is unlikely to match a typical guard likeif __name__ == "__main__":. The.characters will match any character and the quoting doesn’t align with the usual pattern. If you want to ignore standard__main__guards, consider a more accurate regex such as"if __name__ == ['\"]__main__['\"]:"or a simpler literal match that reflects the actual line format.