From 3060bb22084e09ccdc110c9a773c0330e4ce9373 Mon Sep 17 00:00:00 2001 From: Wyatt Hoodes Date: Tue, 23 Jul 2019 09:08:41 -1000 Subject: [PATCH] requirements: Upgrade to mypy 0.720. We also add the option of the newly added `--warn_unreachable` flag. --- requirements/dev.txt | 3 ++- requirements/mypy.in | 2 +- requirements/mypy.txt | 3 ++- tools/run-mypy | 4 ++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/requirements/dev.txt b/requirements/dev.txt index 049fdaef22..07e29f0430 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -90,7 +90,7 @@ matrix-client==0.3.2 mock==2.0.0 moto==1.3.7 mypy-extensions==0.4.1 -mypy==0.711 +mypy==0.720 oauthlib==3.0.1 # via requests-oauthlib, social-auth-core packaging==19.0 # via sphinx parsel==1.5.1 # via scrapy @@ -171,6 +171,7 @@ transifex-client==0.12.5 twilio==6.26.2 twisted==19.2.1 typed-ast==1.4.0 # via mypy +typing-extensions==3.7.4 # via mypy typing==3.6.6 urllib3==1.25.3 # via botocore, requests, transifex-client virtualenv-clone==0.5.3 diff --git a/requirements/mypy.in b/requirements/mypy.in index 3dd73af88c..2d774de11d 100644 --- a/requirements/mypy.in +++ b/requirements/mypy.in @@ -2,4 +2,4 @@ # /tools/update-locked-requirements to update requirements/dev.txt # and requirements/mypy.txt. # See requirements/README.md for more detail. -mypy==0.711 +mypy==0.720 diff --git a/requirements/mypy.txt b/requirements/mypy.txt index aa3d6aefa9..f710bac8b9 100644 --- a/requirements/mypy.txt +++ b/requirements/mypy.txt @@ -8,5 +8,6 @@ # For details, see requirements/README.md . # mypy-extensions==0.4.1 # via mypy -mypy==0.711 +mypy==0.720 typed-ast==1.4.0 # via mypy +typing-extensions==3.7.4 # via mypy diff --git a/tools/run-mypy b/tools/run-mypy index 1284e3f346..aff7ae93d5 100755 --- a/tools/run-mypy +++ b/tools/run-mypy @@ -36,6 +36,8 @@ parser.add_argument('-a', '--all', action='store_true', help="check all files, bypassing the default exclude list") parser.add_argument('--force', action="store_true", help="run tests despite possible provisioning problems") +parser.add_argument('--warn-unreachable', action='store_true', + help="warn of unreachable or redundant code.") args = parser.parse_args() assert_provisioning_status_ok(args.force) @@ -73,6 +75,8 @@ if not python_files and not pyi_files: extra_args = [] if args.quick: extra_args.append("--quick") +elif args.warn_unreachable: + extra_args.append("--warn-unreachable") mypy_args = extra_args + python_files + pyi_files if args.no_daemon: