| 499 | |
| 500 | |
| 501 | def parse_args() -> argparse.Namespace: |
| 502 | parser = argparse.ArgumentParser( |
| 503 | description="Generate a JSON matrix for building distributions in CI" |
| 504 | ) |
| 505 | parser.add_argument( |
| 506 | "--platform", |
| 507 | choices=["darwin", "linux", "windows"], |
| 508 | help="Filter matrix entries by platform", |
| 509 | ) |
| 510 | parser.add_argument( |
| 511 | "--max-shards", |
| 512 | type=int, |
| 513 | default=0, |
| 514 | help="The maximum number of shards allowed; set to zero to disable ", |
| 515 | ) |
| 516 | parser.add_argument( |
| 517 | "--labels", |
| 518 | help="Comma-separated list of labels to filter by (e.g., 'platform:linux,python:3.13')", |
| 519 | ) |
| 520 | parser.add_argument( |
| 521 | "--event", |
| 522 | choices=["pull_request", "push"], |
| 523 | help="The GitHub event type. When 'pull_request', uses ci-defaults.yaml for the default subset.", |
| 524 | ) |
| 525 | parser.add_argument( |
| 526 | "--free-runners", |
| 527 | action="store_true", |
| 528 | help="If only free runners should be used.", |
| 529 | ) |
| 530 | parser.add_argument( |
| 531 | "--force-crate-build", |
| 532 | action="store_true", |
| 533 | help="Force crate builds to be included even without python builds.", |
| 534 | ) |
| 535 | parser.add_argument( |
| 536 | "--matrix-type", |
| 537 | choices=["python-build", "docker-build", "crate-build", "all"], |
| 538 | default="all", |
| 539 | help="Which matrix types to generate (default: all)", |
| 540 | ) |
| 541 | return parser.parse_args() |
| 542 | |
| 543 | |
| 544 | def main() -> None: |