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

Function main

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

Source from the content-addressed store, hash-verified

71
72
73def main() -> None:
74 try:
75 against_ref = sys.argv[1]
76 except IndexError as err:
77 raise RuntimeError("You must specify a base ref to run breaking change detection against") from err
78
79 package = griffe.load(
80 "anthropic",
81 search_paths=[Path(__file__).parent.parent.joinpath("src")],
82 )
83 old_package = griffe.load_git(
84 "anthropic",
85 ref=against_ref,
86 search_paths=["src"],
87 )
88 assert isinstance(package, griffe.Module)
89 assert isinstance(old_package, griffe.Module)
90
91 output = list(find_breaking_changes(package, old_package, path=["anthropic"]))
92 if output:
93 # soft_wrap: CI stdout is not a TTY, so rich would otherwise hard-wrap long symbol paths at 80 columns
94 console = Console(soft_wrap=True)
95 console.print(Text("Breaking changes detected!", style=Style(color="rgb(165, 79, 87)")))
96 console.print()
97
98 for text in output:
99 console.print(text, end="")
100
101 sys.exit(1)
102
103
104main()

Callers 1

Calls 1

find_breaking_changesFunction · 0.85

Tested by

no test coverage detected