Conversation
The mypy lintrunner jobs were not running since these files were missing. Enabling this will require some fixes to our python code but should help keep our ever-growing python codebase clean.
|
|
||
| [mypy] | ||
| python_version = 3.8 | ||
| #plugins = mypy_plugins/check_mypy_version.py, numpy.typing.mypy_plugin |
There was a problem hiding this comment.
This is the only change I made to these files. I don't think we need the mypy version check since we install 1.4.0 in the lintrunner config anyway. I haven't looked through everything else yet. We might want a minimal set of options, or to disable the strict version.
There was a problem hiding this comment.
Another simple approach is to remove the strict version and also remove the --config=mypy.ini argument (and these files), so that we'd use the default settings. We'd probably at least want to set --ignore-missing-imports, so perhaps trimming down mypy.ini to just a few options is preferable.
There was a problem hiding this comment.
I'm wondering if we should just blankly skip checks on specific libraries? i.e.
[mypy]
ignore_missing_imports = True
I know little about mypy, let me know if I'm talking non-sense 😆
mypy-strict.ini
Outdated
| # files. | ||
|
|
||
| [mypy] | ||
| python_version = 3.8 |
.lintrunner.private.toml
Outdated
| @@ -0,0 +1 @@ | |||
| .lintrunner.toml No newline at end of file | |||
There was a problem hiding this comment.
I'm not sure why this symlink is needed, but I have needed it to run lintrunner on my workstation also.
There was a problem hiding this comment.
hmm. this shouldn't be needed. It's probably some funny script issue for lintrunner.
Meanwhile, can we change the command to lintrunner --config .lintrunner.toml XXXXXXX
| self._cls_name = cls_name | ||
|
|
||
| def get_cls(self): | ||
| def get_cls(self) -> Any: |
There was a problem hiding this comment.
I fixed this one missing return type annotation to try and trigger a mypy run over this file. Locally when I run lintrunner nvfuser/nvfuser_version.py I get a number of other errors.
|
Ha, this is likely something that gets accidentally dropped when switching to lintrunner. |
jjsjann123
left a comment
There was a problem hiding this comment.
some nitpick here and there.
.lintrunner.private.toml
Outdated
| @@ -0,0 +1 @@ | |||
| .lintrunner.toml No newline at end of file | |||
There was a problem hiding this comment.
hmm. this shouldn't be needed. It's probably some funny script issue for lintrunner.
Meanwhile, can we change the command to lintrunner --config .lintrunner.toml XXXXXXX
|
|
||
| [mypy] | ||
| python_version = 3.8 | ||
| #plugins = mypy_plugins/check_mypy_version.py, numpy.typing.mypy_plugin |
There was a problem hiding this comment.
I'm wondering if we should just blankly skip checks on specific libraries? i.e.
[mypy]
ignore_missing_imports = True
I know little about mypy, let me know if I'm talking non-sense 😆
This should force mypy to check all the .py files instead of just this stub
|
Review updated until commit d3cb42b Description
Changes walkthrough 📝
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
I don't know if this is required but we currently get a warning about missing .lintrunner.private.toml even though that should be a link to .lintruner.toml
|
@jjsjann123 I updated this PR and I think it's ready for another look. If it gets to be a pain fixing typing errors we could disable it. What do you think? |
|
Running locally via |
sounds good to me. |
Enabling mypy will require some fixes to our python code but should help keep our ever-growing python codebase clean. Similar to the clang-tidy situation, this may mean we should either fix a bunch of errors up front or CI will fail when modifying these files in the future.