typeshed icon indicating copy to clipboard operation
typeshed copied to clipboard

Stubs don't work with numpy 2

Open srittau opened this issue 1 year ago • 2 comments

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

srittau avatar Jun 17 '24 13:06 srittau

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

hamdanal avatar Jun 17 '24 18:06 hamdanal

Nope, doesn't work in CI #12157

hamdanal avatar Jun 17 '24 19:06 hamdanal