mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-01 09:03:23 +08:00
Run mypy and pyright on our py312 stubs in CI (#10119)
This commit is contained in:
@@ -47,7 +47,7 @@ except ImportError:
|
||||
print_error("Cannot import mypy. Did you install it?")
|
||||
sys.exit(1)
|
||||
|
||||
SUPPORTED_VERSIONS = ["3.11", "3.10", "3.9", "3.8", "3.7"]
|
||||
SUPPORTED_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"]
|
||||
SUPPORTED_PLATFORMS = ("linux", "win32", "darwin")
|
||||
DIRECTORIES_TO_TEST = [Path("stdlib"), Path("stubs")]
|
||||
|
||||
@@ -76,6 +76,13 @@ def valid_path(cmd_arg: str) -> Path:
|
||||
return path
|
||||
|
||||
|
||||
def remove_dev_suffix(version: str) -> str:
|
||||
"""Helper function for argument-parsing"""
|
||||
if version.endswith("-dev"):
|
||||
return version[: -len("-dev")]
|
||||
return version
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Typecheck typeshed's stubs with mypy. Patterns are unanchored regexps on the full path."
|
||||
)
|
||||
@@ -105,7 +112,7 @@ parser.add_argument("-v", "--verbose", action="count", default=0, help="More out
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
"--python-version",
|
||||
type=str,
|
||||
type=remove_dev_suffix,
|
||||
choices=SUPPORTED_VERSIONS,
|
||||
nargs="*",
|
||||
action="extend",
|
||||
|
||||
@@ -35,7 +35,7 @@ VENV_DIR = ".venv"
|
||||
TYPESHED = "typeshed"
|
||||
|
||||
SUPPORTED_PLATFORMS = ["linux", "darwin", "win32"]
|
||||
SUPPORTED_VERSIONS = ["3.11", "3.10", "3.9", "3.8", "3.7"]
|
||||
SUPPORTED_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"]
|
||||
|
||||
|
||||
def package_with_test_cases(package_name: str) -> PackageInfo:
|
||||
|
||||
@@ -13,7 +13,7 @@ from utils import colored, print_error
|
||||
ReturnCode: TypeAlias = int
|
||||
|
||||
SUPPORTED_PLATFORMS = ("linux", "darwin", "win32")
|
||||
SUPPORTED_VERSIONS = ("3.11", "3.10", "3.9")
|
||||
SUPPORTED_VERSIONS = ("3.12", "3.11", "3.10", "3.9")
|
||||
LOWEST_SUPPORTED_VERSION = min(SUPPORTED_VERSIONS, key=lambda x: int(x.split(".")[1]))
|
||||
DIRECTORIES_TO_TEST = ("scripts", "tests")
|
||||
EMPTY: list[str] = []
|
||||
|
||||
Reference in New Issue
Block a user