-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This is the first PR to enable MyPy typechecker. There are few next steps, but this can land as-is as a standalone PR. Will keep enabling in smaller batches, via directory by directory. Also side note, pyre-ignore can be migrated to "# type: ignore" since pyre is backwards compatible with mypy.
- Loading branch information
1 parent
9dc5152
commit c86b39d
Showing
16 changed files
with
137 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.hypothesis | ||
buck-out/ | ||
.mypy_cache/ | ||
buck2-bin/ | ||
cmake-out* | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[mypy] | ||
allow_redefinition = True | ||
warn_unused_configs = True | ||
warn_redundant_casts = True | ||
show_error_codes = True | ||
show_column_numbers = True | ||
disallow_untyped_decorators = True | ||
follow_imports = normal | ||
local_partial_types = True | ||
enable_error_code = possibly-undefined | ||
warn_unused_ignores = False | ||
|
||
# TODO(https://github.com/pytorch/executorch/issues/7441): Remove this | ||
# disable_error_code = import-untyped | ||
|
||
files = | ||
backends, | ||
codegen, | ||
devtools | ||
examples, | ||
exir, | ||
extension, | ||
kernels, | ||
profiler, | ||
runtime, | ||
scripts, | ||
util | ||
|
||
mypy_path = executorch | ||
|
||
[mypy-executorch.codegen.*] | ||
follow_untyped_imports = True | ||
|
||
[mypy-executorch.extension.*] | ||
follow_untyped_imports = True | ||
|
||
[mypy-executorch.exir.*] | ||
follow_untyped_imports = True | ||
|
||
[mypy-executorch.kernels.*] | ||
follow_untyped_imports = True | ||
|
||
[mypy-executorch.runtime.*] | ||
follow_untyped_imports = True | ||
|
||
[mypy-torchgen.*] | ||
follow_untyped_imports = True | ||
|
||
[mypy-setuptools.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-buck_util] | ||
ignore_missing_imports = True | ||
|
||
[mypy-tomllib] | ||
ignore_missing_imports = True | ||
|
||
[mypy-zstd] | ||
ignore_missing_imports = True | ||
|
||
[mypy-yaml] | ||
ignore_missing_imports = True | ||
|
||
[mypy-ruamel] | ||
ignore_missing_imports = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,6 @@ usort==1.0.8.post1 | |
# Other linters | ||
clang-format==18.1.3 | ||
cmakelint==1.4.1 | ||
|
||
# MyPy | ||
mypy==1.14.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters