MCPcopy Index your code
hub / github.com/RustPython/RustPython / main

Function main

scripts/update_lib/cmd_quick.py:325–474  ·  view source on GitHub ↗
(argv: list[str] | None = None)

Source from the content-addressed store, hash-verified

323
324
325def main(argv: list[str] | None = None) -> int:
326 parser = argparse.ArgumentParser(
327 description=__doc__,
328 formatter_class=argparse.RawDescriptionHelpFormatter,
329 )
330 parser.add_argument(
331 "path",
332 type=pathlib.Path,
333 help="Source path (file or directory)",
334 )
335 parser.add_argument(
336 "--copy",
337 action=argparse.BooleanOptionalAction,
338 default=True,
339 help="Copy library file (default: enabled, implied disabled if test path)",
340 )
341 parser.add_argument(
342 "--migrate",
343 action=argparse.BooleanOptionalAction,
344 default=True,
345 help="Migrate test file (default: enabled, implied disabled if Lib/ path)",
346 )
347 parser.add_argument(
348 "--auto-mark",
349 action=argparse.BooleanOptionalAction,
350 default=True,
351 help="Auto-mark test failures (default: enabled)",
352 )
353 parser.add_argument(
354 "--mark-failure",
355 action="store_true",
356 help="Add @expectedFailure to failing tests",
357 )
358 parser.add_argument(
359 "--commit",
360 action=argparse.BooleanOptionalAction,
361 default=True,
362 help="Create git commit (default: enabled)",
363 )
364 parser.add_argument(
365 "--build",
366 action=argparse.BooleanOptionalAction,
367 default=True,
368 help="Build with cargo (default: enabled)",
369 )
370
371 args = parser.parse_args(argv)
372
373 try:
374 src_path = args.path
375
376 # Shortcut: expand simple name to cpython/Lib path
377 src_path = _expand_shortcut(src_path)
378 original_src = src_path # Keep for commit
379
380 # Track library path for commit
381 lib_file_path = None
382 test_path = None

Callers 1

cmd_quick.pyFile · 0.70

Calls 15

parse_argsMethod · 0.95
is_test_pathFunction · 0.90
parse_lib_pathFunction · 0.90
copy_libFunction · 0.90
get_module_nameFunction · 0.90
get_cpython_dirFunction · 0.90
get_test_pathsFunction · 0.90
lib_to_test_pathFunction · 0.90
is_lib_pathFunction · 0.90
_expand_shortcutFunction · 0.85
strFunction · 0.85
quickFunction · 0.85

Tested by

no test coverage detected