MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / main

Function main

scripts/detect-breaking-changes.py:50–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48
49
50def main() -> None:
51 try:
52 against_ref = sys.argv[1]
53 except IndexError as err:
54 raise RuntimeError("You must specify a base ref to run breaking change detection against") from err
55
56 package = griffe.load(
57 "anthropic",
58 search_paths=[Path(__file__).parent.parent.joinpath("src")],
59 )
60 old_package = griffe.load_git(
61 "anthropic",
62 ref=against_ref,
63 search_paths=["src"],
64 )
65 assert isinstance(package, griffe.Module)
66 assert isinstance(old_package, griffe.Module)
67
68 output = list(find_breaking_changes(package, old_package, path=["anthropic"]))
69 if output:
70 rich.print(Text("Breaking changes detected!", style=Style(color="rgb(165, 79, 87)")))
71 rich.print()
72
73 for text in output:
74 rich.print(text, end="")
75
76 sys.exit(1)
77
78
79main()

Callers 1

Calls 1

find_breaking_changesFunction · 0.85

Tested by

no test coverage detected