comtypes icon indicating copy to clipboard operation
comtypes copied to clipboard

`npsupport` does not work with `numpy>=2.0.0`

Open junkmd opened this issue 1 year ago • 0 comments

I noticed that the tests for comtypes.npsupport fail when numpy==2.0.0 is installed.

ERROR: test_VT_I4_ndarray_enabled (test_npsupport.NumpySupportTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "...\comtypes\comtypes\test\test_npsupport.py", line 66, in call_enabled
    func(self)
  File "...\comtypes\comtypes\test\test_npsupport.py", line 188, in test_VT_I4_ndarray
    sa = t.from_param(in_arr)
  File "...\comtypes\comtypes\safearray.py", line 214, in from_param
    value = cls.create(value, extra)
  File "...\comtypes\comtypes\safearray.py", line 122, in create
    return cls.create_from_ndarray(value, extra)
  File "...\comtypes\comtypes\safearray.py", line 171, in create_from_ndarray
    raise TypeError("Wrong array item type")
TypeError: Wrong array item type

To avoid a situation where we can't develop other features until npsupport supports numpy==2.0.0, I will change the GHA workflow so that the numpy installed in the CI environment is a version lower than 2.0.0 for the time being.

I'm not particularly familiar with the use cases for npsupport, so I hope that community members who have a high priority for npsupport will fix it.

junkmd avatar Jun 21 '24 14:06 junkmd