sphinx-autodoc-typehints
sphinx-autodoc-typehints copied to clipboard
nptyping dependency is troubled
nptyping hasn't been updated for numpy 2, which makes the self tests fail with:
tests/test_sphinx_autodoc_typehints.py:54: in <module>
import nptyping
/usr/pkg/lib/python3.12/site-packages/nptyping/__init__.py:32: in <module>
from nptyping.ndarray import NDArray
/usr/pkg/lib/python3.12/site-packages/nptyping/ndarray.py:40: in <module>
from nptyping.shape import Shape
/usr/pkg/lib/python3.12/site-packages/nptyping/shape.py:29: in <module>
from nptyping.shape_expression import (
/usr/pkg/lib/python3.12/site-packages/nptyping/shape_expression.py:36: in <module>
from nptyping.typing_ import ShapeExpression, ShapeTuple
/usr/pkg/lib/python3.12/site-packages/nptyping/typing_.py:51: in <module>
Bool8 = np.bool8
/usr/pkg/lib/python3.12/site-packages/numpy/__init__.py:414: in __getattr__
raise AttributeError("module {!r} has no attribute "
E AttributeError: module 'numpy' has no attribute 'bool8'. Did you mean: 'bool'?
There's a bug report open at nptyping in https://github.com/ramonhagenaars/nptyping/issues/124 with no reply. At least one other project has switched to numpy.typing: https://github.com/mhe/pynrrd/pull/154
PR Welcome.
Thank you!
If you're interested in restoring that functionality, my fork of nptyping has the few changes necessary to work with numpy v2: https://github.com/jasper-tms/nptyping