-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixed type errors in mypy
GitHub Action
#6963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
mypy
GitHub Actionmypy
GitHub Action #6962Running the GitHub Action for mypy locally returns successful: