hugapi / hug

Embrace the APIs of the future. Hug aims to make developing APIs as simple as possible, but no simpler.
MIT License
6.86k stars 388 forks source link

adapt for numpy 2.0 #922

Open vincentsarago opened 2 weeks ago

vincentsarago commented 2 weeks ago

np.unicode_ has been removed in Numpy 2.0

https://github.com/hugapi/hug/blob/e4a3fa40f98487a67351311d0da659a6c9ce88a6/hug/output_format.py#L145-L147

   import hug
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/hug/__init__.py", line 36, in <module>
    from hug import (
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/hug/output_format.py", line 145, in <module>
    @json_convert(str, numpy.unicode_)
                       ^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.unicode_` was removed in the NumPy 2.0 release. Use `np.str_` instead.