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: issues with type-checking against numpy 2.1 #138

Closed
neutrinoceros opened this issue Sep 1, 2024 · 1 comment · Fixed by #140
Closed

TYP: issues with type-checking against numpy 2.1 #138

neutrinoceros opened this issue Sep 1, 2024 · 1 comment · Fixed by #140

Comments

@neutrinoceros
Copy link
Collaborator

Type-checking is now failing against NumPy 2.1 (example logs)

We're seeing two errors

cmasher/utils.py: note: In function "_get_cmap_lightness_rank":
cmasher/utils.py:167: error: Unsupported left operand type for - (Never)  [operator]
cmasher/utils.py: note: At top level:
cmasher/utils.py:1554: error: Unused "type: ignore" comment  [unused-ignore]
Found 2 errors in 1 file (checked 63 source files)

The first one I think is a bug in NumPy, which I'll report upstream if it hasn't been done already.
The second one (Unused "type: ignore" comment) would be easy to solve (remove the unused comment), but unfortunately the comment is still needed on Python 3.9, at it isn't supported by NumPy 2.1. Fixing this part will require either dropping Python 3.9 (which is maybe a bit radical, unless we see it as a tradeoff for adding 3.13 (which I intend to do very soon)), or temporarily disabling this warning in mypy's configuration (which sounds much more reasonable).

@neutrinoceros
Copy link
Collaborator Author

neutrinoceros commented Sep 1, 2024

After further testing, the first error, while unclear, appear to be due to a conflict between mypy's configuration (python_version = '3.9') and running against NumPy 2.1
Since both problem are solved by dropping Python 3.9, I'll just go with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant