()
| 48 | |
| 49 | |
| 50 | def 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 | |
| 79 | main() |
no test coverage detected