()
| 889 | |
| 890 | |
| 891 | def parse_args() -> argparse.Namespace: |
| 892 | parser = argparse.ArgumentParser( |
| 893 | description=( |
| 894 | "A tool for managing the build, package and test process of " |
| 895 | "CPython on Apple platforms." |
| 896 | ), |
| 897 | ) |
| 898 | parser.suggest_on_error = True |
| 899 | subcommands = parser.add_subparsers(dest="subcommand", required=True) |
| 900 | |
| 901 | clean = subcommands.add_parser( |
| 902 | "clean", |
| 903 | help="Delete all build directories", |
| 904 | ) |
| 905 | |
| 906 | configure_build = subcommands.add_parser( |
| 907 | "configure-build", help="Run `configure` for the build Python" |
| 908 | ) |
| 909 | make_build = subcommands.add_parser( |
| 910 | "make-build", help="Run `make` for the build Python" |
| 911 | ) |
| 912 | configure_host = subcommands.add_parser( |
| 913 | "configure-host", |
| 914 | help="Run `configure` for a specific platform and target", |
| 915 | ) |
| 916 | make_host = subcommands.add_parser( |
| 917 | "make-host", |
| 918 | help="Run `make` for a specific platform and target", |
| 919 | ) |
| 920 | package = subcommands.add_parser( |
| 921 | "package", |
| 922 | help="Create a release package for the platform", |
| 923 | ) |
| 924 | build = subcommands.add_parser( |
| 925 | "build", |
| 926 | help="Build all platform targets and create the XCframework", |
| 927 | ) |
| 928 | test = subcommands.add_parser( |
| 929 | "test", |
| 930 | help="Run the testbed for a specific platform", |
| 931 | ) |
| 932 | ci = subcommands.add_parser( |
| 933 | "ci", |
| 934 | help="Run build, package, and test", |
| 935 | ) |
| 936 | |
| 937 | # platform argument |
| 938 | for cmd in [clean, configure_host, make_host, package, build, test, ci]: |
| 939 | cmd.add_argument( |
| 940 | "platform", |
| 941 | choices=HOSTS.keys(), |
| 942 | help="The target platform to build", |
| 943 | ) |
| 944 | |
| 945 | # host triple argument |
| 946 | for cmd in [configure_host, make_host]: |
| 947 | cmd.add_argument( |
| 948 | "host", |
no test coverage detected
searching dependent graphs…