typecheck_typeshed.py: Make dir command-line argument positional-only (#8646)

This commit is contained in:
Alex Waygood
2022-08-31 09:14:53 +01:00
committed by GitHub
parent 8b222200e0
commit 86a34c5bd6

View File

@@ -17,6 +17,13 @@ SUPPORTED_VERSIONS = ("3.11", "3.10", "3.9")
DIRECTORIES_TO_TEST = ("scripts", "tests")
parser = argparse.ArgumentParser(description="Run mypy on typeshed's own code in the `scripts` and `tests` directories.")
parser.add_argument(
"dir",
choices=DIRECTORIES_TO_TEST + ([],),
nargs="*",
action="extend",
help=f"Test only these top-level typeshed directories (defaults to {DIRECTORIES_TO_TEST!r})",
)
parser.add_argument(
"--platform",
choices=SUPPORTED_PLATFORMS,
@@ -32,14 +39,6 @@ parser.add_argument(
action="extend",
help="Run mypy for certain Python versions (defaults to sys.version_info[:2])",
)
parser.add_argument(
"-d",
"--dir",
choices=DIRECTORIES_TO_TEST,
nargs="*",
action="extend",
help=f"Test only these top-level typeshed directories (defaults to {DIRECTORIES_TO_TEST!r})",
)
def run_mypy_as_subprocess(directory: str, platform: str, version: str) -> ReturnCode: