Skip to content
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

TYP: update supported Mypy version from 1.0.0 to 1.10.0 #20600

Merged
merged 1 commit into from Apr 28, 2024

Conversation

rgommers
Copy link
Member

This is pretty straightforward; needed to support Python 3.12

@rgommers rgommers added the static typing Items related to static typing label Apr 28, 2024
@rgommers rgommers added this to the 1.14.0 milestone Apr 28, 2024
@github-actions github-actions bot added scipy.stats scipy.special scipy.optimize scipy._lib scipy.spatial CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure labels Apr 28, 2024
@rgommers rgommers removed scipy.stats scipy.special scipy.optimize scipy._lib scipy.spatial CI Items related to the CI tools such as CircleCI, GitHub Actions or Azure labels Apr 28, 2024
Copy link
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff looks "ok" to me, pinning mypy can prevent frequent breaks. I saw a few failures with 3.12 when I ran python dev.py mypy on this branch locally with NumPy 2.0.0rc1 (below the fold).

scipy/spatial/_qhull.pyi:141: error: Name "np.bool_" is not defined  [name-defined]
scipy/_lib/_util.py:31: error: Module "numpy" has no attribute "AxisError"  [attr-defined]
scipy/_lib/_util.py:31: error: Name "AxisError" already defined on line 21  [no-redef]
scipy/_lib/_util.py:31: error: Module "numpy" has no attribute "ComplexWarning"  [attr-defined]
scipy/_lib/_util.py:31: error: Name "ComplexWarning" already defined on line 22  [no-redef]
scipy/_lib/_util.py:31: error: Module "numpy" has no attribute "VisibleDeprecationWarning"  [attr-defined]
scipy/_lib/_util.py:31: error: Name "VisibleDeprecationWarning" already defined on line 23  [no-redef]
scipy/_lib/_util.py:47: error: Unused "type: ignore" comment  [unused-ignore]
scipy/_lib/_util.py:48: error: Unused "type: ignore" comment  [unused-ignore]
scipy/_lib/_util.py:68: error: Unused "type: ignore" comment  [unused-ignore]
scipy/spatial/tests/test_spherical_voronoi.py:130: error: Unused "type: ignore" comment  [unused-ignore]

With NumPy 1.26.4 (basically the stuff from requirements/all.txt) I saw just 1 issue locally:

scipy/spatial/tests/test_spherical_voronoi.py:130: error: Unused "type: ignore" comment [unused-ignore]

but still 24 less errors than on main, so if CI doesn't care and it is just me seeing that fair enough.

@j-bowhay
Copy link
Member

Does this fix the typing issues in #20593?

@rgommers
Copy link
Member Author

so if CI doesn't care and it is just me seeing that fair enough.

Yep. I am seeing a few other errors too locally, but it's essentially impossible to make Mypy happy in multiple configs. So I'd say that if CI is green and the changes make sense, everything else can be ignored.

Does this fix the typing issues in #20593?

No, but I started to work on those, which triggered this PR. I want to keep a Mypy upgrade separate from changes to array API support.

Copy link
Member

@j-bowhay j-bowhay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rgommers

@j-bowhay j-bowhay merged commit d575726 into scipy:main Apr 28, 2024
30 checks passed
@rgommers rgommers deleted the upgrade-mypy branch April 28, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
static typing Items related to static typing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants