forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mypy.ini
275 lines (196 loc) · 5.41 KB
/
mypy.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# This is the PyTorch mypy.ini file (note: don't change this line! -
# test_run_mypy in test/test_type_hints.py uses this string)
[mypy]
plugins = mypy_plugins/check_mypy_version.py
cache_dir = .mypy_cache/normal
warn_unused_configs = True
warn_redundant_casts = True
show_error_codes = True
show_column_numbers = True
check_untyped_defs = True
follow_imports = silent
# do not reenable this:
# https://github.com/pytorch/pytorch/pull/60006#issuecomment-866130657
warn_unused_ignores = False
#
# Note: test/ still has syntax errors so can't be added
#
# Typing tests is low priority, but enabling type checking on the
# untyped test functions (using `--check-untyped-defs`) is still
# high-value because it helps test the typing.
#
files =
torch,
caffe2,
test/test_bundled_images.py,
test/test_bundled_inputs.py,
test/test_complex.py,
test/test_datapipe.py,
test/test_futures.py,
test/test_numpy_interop.py,
test/test_torch.py,
test/test_type_hints.py,
test/test_type_info.py,
test/test_utils.py,
tools/linter/clang_format_utils.py,
tools/linter/clang_tidy.py,
tools/generate_torch_version.py,
tools/render_junit.py,
tools/stats
#
# `exclude` is a regex, not a list of paths like `files` (sigh)
#
exclude = torch/include/|torch/csrc/|torch/distributed/elastic/agent/server/api.py
# Minimum version supported - variable annotations were introduced
# in Python 3.6
python_version = 3.6
#
# Extension modules without stubs.
#
[mypy-torch._C._jit_tree_views]
ignore_missing_imports = True
[mypy-torch.for_onnx.onnx]
ignore_missing_imports = True
#
# Files with various errors. Mostly real errors, possibly some false
# positives as well.
#
[mypy-test_torch]
check_untyped_defs = False
[mypy-torch.testing._internal.hypothesis_utils.*]
ignore_errors = True
[mypy-torch.testing._internal.common_quantization.*]
ignore_errors = True
[mypy-torch.testing._internal.generated.*]
ignore_errors = True
[mypy-torch.testing._internal.distributed.*]
ignore_errors = True
[mypy-torch.nn.modules.pooling]
ignore_errors = True
[mypy-torch.nn.parallel._functions]
ignore_errors = True
[mypy-torch._appdirs]
ignore_errors = True
[mypy-torch.multiprocessing.pool]
ignore_errors = True
[mypy-torch.overrides]
ignore_errors = True
#
# Files with 'type: ignore' comments that are needed if checked with mypy-strict.ini
#
[mypy-tools.render_junit]
warn_unused_ignores = False
[mypy-tools.generate_torch_version]
warn_unused_ignores = False
[mypy-tools.stats.s3_stat_parser]
warn_unused_ignores = False
#
# Adding type annotations to caffe2 is probably not worth the effort
# only work on this if you have a specific reason for it, otherwise
# leave these ignores as they are.
#
[mypy-caffe2.python.*]
ignore_errors = True
[mypy-caffe2.proto.*]
ignore_errors = True
[mypy-caffe2.core.nomnigraph.op_gen]
ignore_errors = True
[mypy-caffe2.contrib.playground.*]
ignore_errors = True
[mypy-caffe2.contrib.gloo.gloo_test]
ignore_errors = True
[mypy-caffe2.contrib.warpctc.ctc_ops_test]
ignore_errors = True
[mypy-caffe2.contrib.prof.cuda_profile_ops_test]
ignore_errors = True
[mypy-caffe2.contrib.nccl.nccl_ops_test]
ignore_errors = True
[mypy-caffe2.distributed.store_ops_test_util]
ignore_errors = True
[mypy-caffe2.experiments.python.device_reduce_sum_bench]
ignore_errors = True
[mypy-caffe2.experiments.python.SparseTransformer]
ignore_errors = True
[mypy-caffe2.experiments.python.convnet_benchmarks]
ignore_errors = True
[mypy-caffe2.contrib.aten.aten_test]
ignore_errors = True
[mypy-caffe2.contrib.aten.docs.sample]
ignore_errors = True
[mypy-caffe2.contrib.tensorboard.tensorboard_exporter]
ignore_errors = True
[mypy-caffe2.contrib.tensorboard.tensorboard_exporter_test]
ignore_errors = True
[mypy-caffe2.quantization.server.*]
ignore_errors = True
#
# Third party dependencies that don't have types.
#
[mypy-tensorflow.*]
ignore_missing_imports = True
[mypy-tensorboard.*]
ignore_missing_imports = True
[mypy-onnx.*]
ignore_missing_imports = True
[mypy-matplotlib.*]
ignore_missing_imports = True
[mypy-numpy.*]
ignore_missing_imports = True
[mypy-hypothesis.*]
ignore_missing_imports = True
[mypy-tqdm.*]
ignore_missing_imports = True
[mypy-multiprocessing.*]
ignore_missing_imports = True
[mypy-setuptools.*]
ignore_missing_imports = True
[mypy-distutils.*]
ignore_missing_imports = True
[mypy-nvd3.*]
ignore_missing_imports = True
[mypy-future.utils]
ignore_missing_imports = True
[mypy-past.builtins]
ignore_missing_imports = True
[mypy-numba.*]
ignore_missing_imports = True
[mypy-PIL.*]
ignore_missing_imports = True
[mypy-moviepy.*]
ignore_missing_imports = True
[mypy-cv2.*]
ignore_missing_imports = True
[mypy-torchvision.*]
ignore_missing_imports = True
[mypy-pycuda.*]
ignore_missing_imports = True
[mypy-tensorrt.*]
ignore_missing_imports = True
[mypy-tornado.*]
ignore_missing_imports = True
[mypy-pydot.*]
ignore_missing_imports = True
[mypy-networkx.*]
ignore_missing_imports = True
[mypy-scipy.*]
ignore_missing_imports = True
[mypy-IPython.*]
ignore_missing_imports = True
[mypy-google.protobuf.textformat]
ignore_missing_imports = True
[mypy-lmdb.*]
ignore_missing_imports = True
[mypy-mpi4py.*]
ignore_missing_imports = True
[mypy-skimage.*]
ignore_missing_imports = True
[mypy-librosa.*]
ignore_missing_imports = True
[mypy-mypy.*]
ignore_missing_imports = True
[mypy-xml.*]
ignore_missing_imports = True
[mypy-boto3.*]
ignore_missing_imports = True
[mypy-dill.*]
ignore_missing_imports = True