From 214c0fdc4bda3c6d5e2d81ff9d82fa33ec6398f5 Mon Sep 17 00:00:00 2001 From: Catherine Lee Date: Fri, 13 Jan 2023 22:57:04 +0000 Subject: [PATCH] MYPYNOFOLLOW for test_utils (#92136) lintrunner went from 10 minutes to 25 minutes after 333540a458d40603feea84d30e4ad9b96b07318d since test/test_utils.py imports op_db, which takes 10+ minutes to run mypy on, so switch it to the the group of files that doesn't follow imports Pull Request resolved: https://github.com/pytorch/pytorch/pull/92136 Approved by: https://github.com/ZainRizvi, https://github.com/huydhn --- .lintrunner.toml | 2 +- mypy-nofollow.ini | 3 ++- mypy.ini | 3 +-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.lintrunner.toml b/.lintrunner.toml index 073ab891c4fe..ad02cd7b4db8 100644 --- a/.lintrunner.toml +++ b/.lintrunner.toml @@ -95,7 +95,6 @@ include_patterns = [ 'test/test_torch.py', 'test/test_type_hints.py', 'test/test_type_info.py', - 'test/test_utils.py', ] exclude_patterns = [ 'torch/include/**', @@ -166,6 +165,7 @@ include_patterns = [ 'torch/_dynamo/optimizations/training.py', 'torch/_inductor/graph.py', 'torch/_C/_dynamo/**/*.py', + 'test/test_utils.py', # used to by in MYPY but after importing op_db it took 10+ minutes ] exclude_patterns = [ ] diff --git a/mypy-nofollow.ini b/mypy-nofollow.ini index 5b5358643774..e2cc39bd9754 100644 --- a/mypy-nofollow.ini +++ b/mypy-nofollow.ini @@ -15,7 +15,8 @@ warn_unused_ignores = False disallow_any_generics = True files = - torch/_dynamo + torch/_dynamo, + test/test_utils.py # Minimum version supported - variable annotations were introduced # in Python 3.7 diff --git a/mypy.ini b/mypy.ini index eb6b50218a96..4afe7dcf1255 100644 --- a/mypy.ini +++ b/mypy.ini @@ -35,8 +35,7 @@ files = test/test_numpy_interop.py, test/test_torch.py, test/test_type_hints.py, - test/test_type_info.py, - test/test_utils.py + test/test_type_info.py # # `exclude` is a regex, not a list of paths like `files` (sigh)