()
| 29 | |
| 30 | |
| 31 | def main(): |
| 32 | host_platform = current_host_platform() |
| 33 | |
| 34 | # Note these arguments must be synced with `build.py` |
| 35 | parser = argparse.ArgumentParser() |
| 36 | |
| 37 | parser.add_argument( |
| 38 | "--target-triple", |
| 39 | default=default_target_triple(), |
| 40 | choices=supported_targets(TARGETS_CONFIG), |
| 41 | help="Target host triple to build for", |
| 42 | ) |
| 43 | |
| 44 | # Construct possible options, we use a set here for canonical ordering |
| 45 | options = set() |
| 46 | options.update({"debug", "noopt", "pgo", "lto", "pgo+lto"}) |
| 47 | options.update({f"freethreaded+{option}" for option in options}) |
| 48 | options.update({f"{option}+static" for option in options}) |
| 49 | parser.add_argument( |
| 50 | "--options", |
| 51 | choices=options, |
| 52 | default="noopt", |
| 53 | help="Build options to apply when compiling Python", |
| 54 | ) |
| 55 | parser.add_argument( |
| 56 | "--python", |
| 57 | choices={ |
| 58 | "cpython-3.10", |
| 59 | "cpython-3.11", |
| 60 | "cpython-3.12", |
| 61 | "cpython-3.13", |
| 62 | "cpython-3.14", |
| 63 | "cpython-3.15", |
| 64 | }, |
| 65 | default="cpython-3.11", |
| 66 | help="Python distribution to build", |
| 67 | ) |
| 68 | parser.add_argument( |
| 69 | "--python-source", |
| 70 | default=None, |
| 71 | help="A custom path to CPython source files to use", |
| 72 | ) |
| 73 | parser.add_argument( |
| 74 | "--break-on-failure", |
| 75 | action="store_true", |
| 76 | help="Enter a Python debugger if an error occurs", |
| 77 | ) |
| 78 | parser.add_argument( |
| 79 | "--no-docker", |
| 80 | action="store_true", |
| 81 | default=True if sys.platform == "darwin" else False, |
| 82 | help="Disable building in Docker on Linux hosts.", |
| 83 | ) |
| 84 | parser.add_argument( |
| 85 | "--serial", |
| 86 | action="store_true", |
| 87 | help="Build packages serially, without parallelism", |
| 88 | ) |
no test coverage detected