I recently proposed gh-13613 (https://github.com/scipy/scipy/pull/13613) which adds CI for type checking and noticed this failure: ``` scipy/_lib/_uarray/_backend.py:96: error: syntax error in type comment [syntax] Found 1 error in 1 file (checked 662 source files) ``` I don't see any errors with Python 3.8.0 and mypy 0.770, mypy 0.780, and mypy 0.812 (latest release). So, this probably has something to do with Python 3.9.0a5 (which is currently being installed on ubuntu-latest). I checked with mypy 0.780, mypy 0.800, and mypy 0.812 on Python 3.9.0a5. This error disappears in all those versions but dozens of others arise. I think this error is related to python/mypy#8614 (https://github.com/python/mypy/issues/8614) which got fixed in mypy>=0.780. So, if I am not wrong, we have two options here: - Stick with Python 3.8 and mypy 0.770. - Use mypy latest (0.812 currently) which works for both Python 3.8 and Python 3.9. I think the latter would be a better choice as NumPy does it and mypy is changing fast so it will help keep up with new changes. I have a fix for all the errors occurring with mypy latest (mypy 0.812) and would add the changes to the PR if there is a consensus to go that way! -- Kind Regards, Tirth Patel
On Fri, Feb 26, 2021 at 10:13 AM Tirth Patel <tirthasheshpatel@gmail.com> wrote:
I recently proposed gh-13613 (https://github.com/scipy/scipy/pull/13613) which adds CI for type checking and noticed this failure:
``` scipy/_lib/_uarray/_backend.py:96: error: syntax error in type comment [syntax] Found 1 error in 1 file (checked 662 source files) ```
I don't see any errors with Python 3.8.0 and mypy 0.770, mypy 0.780, and mypy 0.812 (latest release). So, this probably has something to do with Python 3.9.0a5 (which is currently being installed on ubuntu-latest). I checked with mypy 0.780, mypy 0.800, and mypy 0.812 on Python 3.9.0a5. This error disappears in all those versions but dozens of others arise.
I think this error is related to python/mypy#8614 (https://github.com/python/mypy/issues/8614) which got fixed in mypy>=0.780.
So, if I am not wrong, we have two options here: - Stick with Python 3.8 and mypy 0.770. - Use mypy latest (0.812 currently) which works for both Python 3.8 and Python 3.9.
I think the latter would be a better choice as NumPy does it and mypy is changing fast so it will help keep up with new changes. I have a fix for all the errors occurring with mypy latest (mypy 0.812) and would add the changes to the PR if there is a consensus to go that way!
Yes we can bump mypy versions, no problem to update to the most recent version if needed. It's not a runtime dependency, so there's not much of a downside to updating other than a few maintainers and contributers needing to update their local version. Thanks for working on this Tirth! Cheers, Ralf
-- Kind Regards, Tirth Patel _______________________________________________ SciPy-Dev mailing list SciPy-Dev@python.org https://mail.python.org/mailman/listinfo/scipy-dev
participants (2)
-
Ralf Gommers -
Tirth Patel