-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add static type check with mypy (#2195)
* add mypy config * fix syntax error * fix annotations in torchvision/utils.py * add mypy type check to CircleCI * add mypy cache to ignore files * try fix CI * ignore flake8 F821 since it interferes with mypy * add mypy type check to config generator * explicitly set config files
- Loading branch information
Showing
7 changed files
with
72 additions
and
10 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
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,4 @@ htmlcov | |
*.swp | ||
*.swo | ||
gen.yml | ||
.mypy_cache |
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,30 @@ | ||
[mypy] | ||
|
||
files = torchvision | ||
show_error_codes = True | ||
pretty = True | ||
|
||
[mypy-torchvision.datasets.*] | ||
|
||
ignore_errors = True | ||
|
||
[mypy-torchvision.io.*] | ||
|
||
ignore_errors = True | ||
|
||
[mypy-torchvision.models.*] | ||
|
||
ignore_errors = True | ||
|
||
[mypy-torchvision.ops.*] | ||
|
||
ignore_errors = True | ||
|
||
[mypy-torchvision.transforms.*] | ||
|
||
ignore_errors = True | ||
|
||
[mypy-PIL] | ||
|
||
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
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