From bf246b28a987aafa3111293b3027b4fae086ad79 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 22 Dec 2021 16:57:07 +0100 Subject: [PATCH] Update to mypy 0.921 (#6657) Test third-party stubs with typeshed from mypy --- requirements-tests.txt | 2 +- tests/mypy_test.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 318c0358a..0e523178a 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,4 +1,4 @@ -mypy==0.920 +mypy==0.921 pytype==2021.11.29; platform_system != "Windows" # must match .pre-commit-config.yaml black==21.12b0 diff --git a/tests/mypy_test.py b/tests/mypy_test.py index 8c5bfc158..0e36f0fa6 100755 --- a/tests/mypy_test.py +++ b/tests/mypy_test.py @@ -196,7 +196,7 @@ def run_mypy(args, configurations, major, minor, files, *, custom_typeshed=False return 0 -def get_mypy_flags(args, major: int, minor: int, temp_name: str, *, custom_typeshed: bool) -> list[str]: +def get_mypy_flags(args, major: int, minor: int, temp_name: str, *, custom_typeshed: bool = False) -> list[str]: flags = [ "--python-version", "%d.%d" % (major, minor), @@ -277,8 +277,7 @@ def test_third_party_distribution(distribution: str, major: int, minor: int, arg print("--- no files found ---") sys.exit(1) - # TODO: remove custom_typeshed after mypy 0.920 is released - code = run_mypy(args, configurations, major, minor, files, custom_typeshed=True) + code = run_mypy(args, configurations, major, minor, files) return code, len(files) @@ -326,8 +325,7 @@ def main(): files_checked += len(files) # Test files of all third party distributions. - # TODO: remove custom_typeshed after mypy 0.920 is released - print("Running mypy " + " ".join(get_mypy_flags(args, major, minor, "/tmp/...", custom_typeshed=True))) + print("Running mypy " + " ".join(get_mypy_flags(args, major, minor, "/tmp/..."))) for distribution in sorted(os.listdir("stubs")): if not is_supported(distribution, major): continue