Fixed type errors in mypy GitHub Action#6963
Conversation
|
That is weird, with Actually the pyupgrade pre-commit hook should even replace the typing versions by built-in versions. |
|
Could you add an additional mypy workflow to test this behavior? |
|
When I run locally |
|
@dcherian on a different issue: can we prevent that the auto labeler removes manually added labels? |
no idea. cc @TomNicholas |
|
Seems that pyupgrade does not update Looks good to me now 👍 |
|
Seems like dasks typing is also not compatible with python 3.8, haha |
|
I cannot reproduce the mypy error locally. |
|
I get some errors: (not sure why |
|
Hmmm, these errors should be fixed in the latest version of this PR. The problem CI is running into is that mypy runs into an unrecoverable error parsing dask, this I cannot reproduce locally. |
Sorry, my test was on main. I can rerun on this PR. |
|
I can't repro the failure on the current PR I'm not sure why it's raising an error for an imported module where And weirdly, I get errors running mypy in dask latest main, but not this error! |
|
It seems that mypy encountered an unrecoverable runtime error. |
|
Dask is on the ignore list: Lines 31 to 43 in d6671dd This seems to ignore the list and follow-imports doesn't seem to work either: A good ol' copy/paste job works as expected though. :) I think we can discuss more elegant solutions in a follow up PR. |
So now mypy is not crashing anymore? Thats weird, we should open an issue on mypy about this... |
| run: | | ||
| python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report | ||
|
|
||
| - name: Upload mypy coverage to Codecov |
There was a problem hiding this comment.
Do we need to upload this to codecov? The coverage should be the same as for the newest python.
There was a problem hiding this comment.
Not really, I just kept it simple with the copy/pasting as I suspect we can do this workflow in a smarter way; similar way as the pytest CI or the mypy --python-version 3.8-way.
I think we can just focus on getting the xarray bugs fixed in this PR and not get stuck with the CI semantics.
| python xarray/util/print_versions.py | ||
| - name: Install mypy | ||
| run: | | ||
| python -m pip install 'mypy<0.990' |
There was a problem hiding this comment.
Is mypy=0.990 still crashing?
This one throws errors still: |
I don't think we ever used We should report this mypy bug... |
|
Thanks, @lukeconibear ! |
Fixed type errors in
mypyGitHub ActionmypyGitHub Action #6962Running the GitHub Action for mypy locally returns successful: