MCPcopy
hub / github.com/python/mypy / parse_options

Function parse_options

mypy/stubtest.py:2510–2584  ·  view source on GitHub ↗
(args: list[str])

Source from the content-addressed store, hash-verified

2508
2509
2510def parse_options(args: list[str]) -> _Arguments:
2511 parser = argparse.ArgumentParser(
2512 description="Compares stubs to objects introspected from the runtime."
2513 )
2514 parser.add_argument("modules", nargs="*", help="Modules to test")
2515 parser.add_argument(
2516 "--concise",
2517 action="store_true",
2518 help="Makes stubtest's output more concise, one line per error",
2519 )
2520 parser.add_argument(
2521 "--ignore-missing-stub",
2522 action="store_true",
2523 help="Ignore errors for stub missing things that are present at runtime",
2524 )
2525 parser.add_argument(
2526 "--ignore-positional-only",
2527 action="store_true",
2528 help="Ignore errors for whether an argument should or shouldn't be positional-only",
2529 )
2530 # TODO: Remove once PEP 800 is accepted
2531 parser.add_argument(
2532 "--ignore-disjoint-bases",
2533 action="store_true",
2534 help="Disable checks for PEP 800 @disjoint_base classes",
2535 )
2536 parser.add_argument(
2537 "--strict-type-check-only",
2538 action="store_true",
2539 help="Require @type_check_only on private types that are not present at runtime",
2540 )
2541 parser.add_argument(
2542 "--allowlist",
2543 "--whitelist",
2544 action="append",
2545 metavar="FILE",
2546 default=[],
2547 help=(
2548 "Use file as an allowlist. Can be passed multiple times to combine multiple "
2549 "allowlists. Allowlists can be created with --generate-allowlist. Allowlists "
2550 "support regular expressions."
2551 ),
2552 )
2553 parser.add_argument(
2554 "--generate-allowlist",
2555 "--generate-whitelist",
2556 action="store_true",
2557 help="Print an allowlist (to stdout) to be used with --allowlist",
2558 )
2559 parser.add_argument(
2560 "--ignore-unused-allowlist",
2561 "--ignore-unused-whitelist",
2562 action="store_true",
2563 help="Ignore unused allowlist entries",
2564 )
2565 parser.add_argument(
2566 "--mypy-config-file",
2567 metavar="FILE",

Callers 7

run_stubtest_with_stderrFunction · 0.90
test_missing_stubsMethod · 0.90
test_only_pyMethod · 0.90
test_no_modulesMethod · 0.90
mainFunction · 0.70

Calls 2

_ArgumentsClass · 0.85
add_argumentMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…