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

Function main

Platforms/Apple/testbed/__main__.py:286–426  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

284
285
286def main():
287 # Look for directories like `iOSTestbed` as an indicator of the platforms
288 # that the testbed folder supports. The original source testbed can support
289 # many platforms, but when cloned, only one platform is preserved.
290 available_platforms = [
291 platform
292 for platform in ["iOS"]
293 if (Path(__file__).parent / f"{platform}Testbed").is_dir()
294 ]
295
296 parser = argparse.ArgumentParser(
297 description=(
298 "Manages the process of testing an Apple Python project "
299 "through Xcode."
300 ),
301 )
302
303 subcommands = parser.add_subparsers(dest="subcommand")
304 clone = subcommands.add_parser(
305 "clone",
306 description=(
307 "Clone the testbed project, copying in a Python framework and"
308 "any specified application code."
309 ),
310 help="Clone a testbed project to a new location.",
311 )
312 clone.add_argument(
313 "--framework",
314 help=(
315 "The location of the XCFramework (or simulator-only slice of an "
316 "XCFramework) to use when running the testbed"
317 ),
318 )
319 clone.add_argument(
320 "--platform",
321 dest="platform",
322 choices=available_platforms,
323 default=available_platforms[0],
324 help=f"The platform to target (default: {available_platforms[0]})",
325 )
326 clone.add_argument(
327 "--app",
328 dest="apps",
329 action="append",
330 default=[],
331 help="The location of any code to include in the testbed project",
332 )
333 clone.add_argument(
334 "location",
335 help="The path where the testbed will be cloned.",
336 )
337
338 run = subcommands.add_parser(
339 "run",
340 usage=(
341 "%(prog)s [-h] [--simulator SIMULATOR] -- "
342 "<test arg> [<test arg> ...]"
343 ),

Callers 1

__main__.pyFile · 0.70

Calls 12

add_subparsersMethod · 0.95
parse_argsMethod · 0.95
print_helpMethod · 0.95
PathClass · 0.90
clone_testbedFunction · 0.85
add_parserMethod · 0.80
run_testbedFunction · 0.70
is_dirMethod · 0.45
add_argumentMethod · 0.45
indexMethod · 0.45
resolveMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…