MCPcopy
hub / github.com/astral-sh/python-build-standalone / main

Function main

cpython-unix/build-main.py:31–214  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29
30
31def 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 )

Callers 1

build-main.pyFile · 0.70

Calls 9

current_host_platformFunction · 0.90
default_target_tripleFunction · 0.90
supported_targetsFunction · 0.90
get_target_settingsFunction · 0.90
release_tag_from_gitFunction · 0.90
compress_python_archiveFunction · 0.90
updateMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected