Main entry point.
()
| 654 | |
| 655 | |
| 656 | def main(): |
| 657 | """Main entry point.""" |
| 658 | parser = argparse.ArgumentParser( |
| 659 | description="Apache Artifacts Verification Tool", |
| 660 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 661 | epilog=""" |
| 662 | Examples: |
| 663 | # List contents of a specific artifact |
| 664 | python scripts/verify_apache_artifacts.py list-contents dist/apache-burr-0.41.0-incubating-src.tar.gz |
| 665 | python scripts/verify_apache_artifacts.py list-contents dist/apache_burr-0.41.0-py3-none-any.whl |
| 666 | |
| 667 | # Verify signatures and checksums only |
| 668 | python scripts/verify_apache_artifacts.py signatures |
| 669 | |
| 670 | # Verify licenses with Apache RAT |
| 671 | python scripts/verify_apache_artifacts.py licenses --rat-jar /path/to/apache-rat.jar |
| 672 | |
| 673 | # Verify everything |
| 674 | python scripts/verify_apache_artifacts.py all --rat-jar /path/to/apache-rat.jar |
| 675 | |
| 676 | # Report-only mode (don't fail on license issues) |
| 677 | python scripts/verify_apache_artifacts.py licenses --rat-jar /path/to/apache-rat.jar --report-only |
| 678 | |
| 679 | # Custom artifacts directory |
| 680 | python scripts/verify_apache_artifacts.py all --artifacts-dir /path/to/artifacts --rat-jar /path/to/rat.jar |
| 681 | """, |
| 682 | ) |
| 683 | |
| 684 | subparsers = parser.add_subparsers(dest="command", required=True) |
| 685 | |
| 686 | # list-contents subcommand |
| 687 | list_parser = subparsers.add_parser( |
| 688 | "list-contents", help="List contents of a specific artifact" |
| 689 | ) |
| 690 | list_parser.add_argument("artifact", help="Path to artifact file (.tar.gz or .whl)") |
| 691 | |
| 692 | # signatures subcommand |
| 693 | sig_parser = subparsers.add_parser( |
| 694 | "signatures", help="Verify GPG signatures and SHA512 checksums" |
| 695 | ) |
| 696 | sig_parser.add_argument( |
| 697 | "--artifacts-dir", default="dist", help="Directory containing artifacts (default: dist)" |
| 698 | ) |
| 699 | |
| 700 | # licenses subcommand |
| 701 | lic_parser = subparsers.add_parser("licenses", help="Verify licenses with Apache RAT") |
| 702 | lic_parser.add_argument( |
| 703 | "--artifacts-dir", default="dist", help="Directory containing artifacts (default: dist)" |
| 704 | ) |
| 705 | lic_parser.add_argument("--rat-jar", required=True, help="Path to Apache RAT JAR file") |
| 706 | lic_parser.add_argument( |
| 707 | "--report-only", action="store_true", help="Generate report but don't fail on issues" |
| 708 | ) |
| 709 | |
| 710 | # all subcommand |
| 711 | all_parser = subparsers.add_parser("all", help="Verify everything (signatures + licenses)") |
| 712 | all_parser.add_argument( |
| 713 | "--artifacts-dir", default="dist", help="Directory containing artifacts (default: dist)" |
no test coverage detected