MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / main

Function main

tools/test_selector.py:871–946  ·  view source on GitHub ↗
(argv: Sequence[str] | None = None)

Source from the content-addressed store, hash-verified

869
870
871def main(argv: Sequence[str] | None = None) -> int:
872 ap = argparse.ArgumentParser(description="Deterministic DeepLabCut test selector")
873 ap.add_argument("--json", action="store_true", help="Print JSON result to stdout")
874 ap.add_argument(
875 "--write-github-output",
876 action="store_true",
877 help="Write outputs to $GITHUB_OUTPUT",
878 )
879 ap.add_argument(
880 "--base-sha",
881 default=None,
882 help="Override base commit SHA for manual diff selection (must be used with --head-sha)",
883 )
884 ap.add_argument(
885 "--head-sha",
886 default=None,
887 help="Override head commit SHA for manual diff selection (must be used with --base-sha)",
888 )
889
890 ap.add_argument(
891 "--report-dir",
892 default="tmp/test-selection",
893 help="Directory to write decision report files (selection.json, decision.md)",
894 )
895 ap.add_argument(
896 "--write-summary",
897 action="store_true",
898 help="Append decision.md to GitHub Actions Job Summary if available",
899 )
900 ap.add_argument(
901 "--report-style",
902 choices=["minimal", "detailed"],
903 default="detailed",
904 help="Decision markdown verbosity: minimal or detailed (default: detailed)",
905 )
906 ap.add_argument(
907 "--no-emoji",
908 action="store_true",
909 help="Disable emojis in markdown report (default: off)",
910 )
911
912 args = ap.parse_args(list(argv) if argv is not None else None)
913 if bool(args.base_sha) != bool(args.head_sha):
914 ap.error("Both --base-sha and --head-sha must be provided together")
915
916 repo = find_repo_root()
917
918 base, head, diff_mode = determine_diff_range(repo, args.base_sha, args.head_sha)
919 files = changed_files(repo, base, head)
920
921 res = decide(files)
922 res.diff_mode = diff_mode
923 res.changed_files = files
924 res = validate_selected_paths(res, repo)
925
926 # Strict validation
927 try:
928 res = SelectorResult.model_validate(res.model_dump())

Callers 1

test_selector.pyFile · 0.70

Calls 9

determine_diff_rangeFunction · 0.85
changed_filesFunction · 0.85
decideFunction · 0.85
validate_selected_pathsFunction · 0.85
write_report_filesFunction · 0.85
write_github_outputFunction · 0.85
create_job_summaryFunction · 0.85
errorMethod · 0.80
find_repo_rootFunction · 0.70

Tested by

no test coverage detected