MCPcopy Create free account
hub / github.com/openai/openai-agents-python / main

Function main

examples/run_examples.py:877–909  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

875
876
877def main() -> int:
878 args = parse_args()
879 if args.print_auto_skip:
880 for entry in sorted(load_auto_skip()):
881 print(entry)
882 return 0
883
884 if args.collect:
885 paths = parse_rerun_from_log(Path(args.collect))
886 if args.output:
887 out = Path(args.output)
888 ensure_dirs(out, is_file=True)
889 out.write_text("\n".join(paths) + "\n", encoding="utf-8")
890 print(f"Wrote {len(paths)} entries to {out}")
891 else:
892 for p in paths:
893 print(p)
894 return 0
895
896 examples = discover_examples(args.filter)
897 if args.rerun_file:
898 rerun_set = {
899 line.strip()
900 for line in Path(args.rerun_file).read_text(encoding="utf-8").splitlines()
901 if line.strip()
902 }
903 examples = [ex for ex in examples if ex.relpath in rerun_set]
904 if not examples:
905 print("Rerun list is empty; nothing to do.")
906 return 0
907 print(f"Rerun mode: {len(examples)} example(s) from {args.rerun_file}")
908
909 return run_examples(examples, args)
910
911
912if __name__ == "__main__":

Callers 1

run_examples.pyFile · 0.70

Calls 8

load_auto_skipFunction · 0.85
parse_rerun_from_logFunction · 0.85
ensure_dirsFunction · 0.85
discover_examplesFunction · 0.85
run_examplesFunction · 0.85
write_textMethod · 0.80
read_textMethod · 0.80
parse_argsFunction · 0.70

Tested by

no test coverage detected