typeshed
typeshed copied to clipboard
Stubs don't work with numpy 2
mypy fails:
/tmp/tmpukd3yzxb/.venv-393476311071167225/lib/python3.11/site-packages/numpy/ma/extras.pyi:2: error: Cannot find implementation or library stub for module named "numpy.lib.index_tricks" [import-not-found]
/tmp/tmpukd3yzxb/.venv-393476311071167225/lib/python3.11/site-packages/numpy/ma/extras.pyi:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Affects:
- [ ] seaborn
- [ ] shapely
- [ ] tensorflow
Linking https://github.com/numpy/numpy/issues/26712
Clearing the mypy cache as mentioned in the linked numpy issue does seem to fix the stubtest failure for me locally (I got a failing stubtest test on Python 3.8 then after rm -rf .mypy_cache/ the same test passed).
Edit: tested on shapely stubs only
Nope, doesn't work in CI #12157