()
| 244 | |
| 245 | |
| 246 | def main() -> int: |
| 247 | root = find_repo_root() |
| 248 | t0 = time.monotonic() |
| 249 | |
| 250 | print("Generating third-party notices...") |
| 251 | print() |
| 252 | |
| 253 | print("Collecting Rust dependencies...") |
| 254 | rust_groups = get_rust_notices() |
| 255 | rust_count = sum(len(g["crates"]) for g in rust_groups) |
| 256 | print(f" {rust_count} Rust packages across {len(rust_groups)} license groups") |
| 257 | print() |
| 258 | |
| 259 | print("Collecting Python dependencies...") |
| 260 | python_packages = get_python_notices() |
| 261 | print(f" {len(python_packages)} Python packages") |
| 262 | print() |
| 263 | |
| 264 | notices = format_notices(rust_groups, python_packages) |
| 265 | output = root / "THIRD-PARTY-NOTICES" |
| 266 | output.write_text(notices) |
| 267 | |
| 268 | elapsed = time.monotonic() - t0 |
| 269 | line_count = notices.count("\n") + 1 |
| 270 | print(f"Wrote {output.name} ({line_count} lines, {len(notices)} bytes)") |
| 271 | print(f"Done in {elapsed:.1f}s") |
| 272 | return 0 |
| 273 | |
| 274 | |
| 275 | if __name__ == "__main__": |
no test coverage detected