seperman / deepdiff

DeepDiff: Deep Difference and search of any Python object/data. DeepHash: Hash of any object based on its contents. Delta: Use deltas to reconstruct objects by adding deltas together.
http://zepworks.com
Other
2.03k stars 224 forks source link

Deepdiff incompatible with numpy 2.0 #464

Closed Kircheneer closed 5 months ago

Kircheneer commented 5 months ago

Describe the bug

Numpy 2.0 was released yesterday. Deepdiff appears incompatible right now and also doesn't specify a compatible dependency range.

To Reproduce

>>> import deepdiff
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/deepdiff/__init__.py", line 10, in <module>
    from .diff import DeepDiff
  File "/usr/local/lib/python3.11/site-packages/deepdiff/diff.py", line 16, in <module>
    from deepdiff.helper import (strings, bytes_type, numbers, uuids, times, ListItemRemovedOrAdded, notpresent,
  File "/usr/local/lib/python3.11/site-packages/deepdiff/helper.py", line 60, in <module>
    np_float_ = np.float_
                ^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.. Did you mean: 'float16'?
Steps to reproduce the behavior

Expected behavior

Deepdiff works with Numpy 2.0, but prior to that, deepdiff specifies a numpy dependency range.

OS, DeepDiff version and Python version

Additional context

n.a.

Kircheneer commented 5 months ago

Note that this is not incredibly urgent, as it is of course easy to specify this dependency yourself 👍🏻

seperman commented 5 months ago

Thanks @Kircheneer ! I will take a look when I have a chance. PRs are also always very welcome!

seperman commented 5 months ago

@Kircheneer I can't reproduce this issue. You are using an old version of DeepDiff. Please re-open this ticket if you can reproduce the problem on the latest version of DeepDiff.