MCPcopy Index your code
hub / github.com/python/cpython / main

Function main

Platforms/WASI/__main__.py:14–155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13
14def main():
15 default_host_runner = (
16 "{WASMTIME} run "
17 # Set argv0 so that getpath.py can auto-discover the sysconfig data directory.
18 "--argv0 {ARGV0} "
19 # Map the checkout to / to load the stdlib from /Lib.
20 "--dir {CHECKOUT}::/ "
21 # Flags involving --optimize, --codegen, --debug, --wasm, and --wasi can be kept
22 # in a config file.
23 # We are using such a file to act as defaults in case a user wants to override
24 # only some of the settings themselves, make it easy to modify settings
25 # post-build so that they immediately apply to the Makefile instead of having to
26 # regenerate it, and allow for easy copying of the settings for anyone else who
27 # may want to use them.
28 "--config {WASMTIME_CONFIG_PATH}"
29 )
30
31 parser = argparse.ArgumentParser()
32 subcommands = parser.add_subparsers(dest="subcommand")
33 build = subcommands.add_parser("build", help="Build everything")
34 configure_build = subcommands.add_parser(
35 "configure-build-python", help="Run `configure` for the build Python"
36 )
37 make_build = subcommands.add_parser(
38 "make-build-python", help="Run `make` for the build Python"
39 )
40 build_python = subcommands.add_parser(
41 "build-python", help="Build the build Python"
42 )
43 configure_host = subcommands.add_parser(
44 "configure-host",
45 help="Run `configure` for the "
46 "host/WASI (pydebug builds "
47 "are inferred from the build "
48 "Python)",
49 )
50 make_host = subcommands.add_parser(
51 "make-host", help="Run `make` for the host/WASI"
52 )
53 build_host = subcommands.add_parser(
54 "build-host", help="Build the host/WASI Python"
55 )
56 subcommands.add_parser(
57 "clean", help="Delete files and directories created by this script"
58 )
59 for subcommand in (
60 build,
61 configure_build,
62 make_build,
63 build_python,
64 configure_host,
65 make_host,
66 build_host,
67 ):
68 subcommand.add_argument(
69 "--quiet",
70 action="store_true",
71 default=False,

Callers 1

__main__.pyFile · 0.70

Calls 4

add_subparsersMethod · 0.95
parse_argsMethod · 0.95
add_parserMethod · 0.80
add_argumentMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…