frejanordsiek / hdf5storage

Python package to read and write a wide range of Python types to/from HDF5 formatted files. Can read/write data to the HDF5 based Matlab v7.3 MAT files.
BSD 2-Clause "Simplified" License
82 stars 24 forks source link

hdf5storage 0.1.18 is broken with setuptools 66.0.0 #125

Closed joerg-tt closed 1 year ago

joerg-tt commented 1 year ago

As of https://github.com/pypa/setuptools/commit/217d9267e017aed6ddff36fa47d82ceb475cbf22 version 66.0.0, hdf5storage fails to initialize the MarshallerCollection.

Reason: In https://github.com/frejanordsiek/hdf5storage/blob/0.1.18/hdf5storage/__init__.py#L902 one of the elements loaded from the Marshallers module is parse_version, which now is a class in setuptools instead of a function. Subsequently, the call m() fails, because parse_version expects an argument.

grafik

  File "C:\Python310\lib\site-packages\hdf5storage\__init__.py", line 1759, in loadmat
    options = Options(marshaller_collection=marshaller_collection)
  File "C:\Python310\lib\site-packages\hdf5storage\__init__.py", line 260, in __init__
    self.marshaller_collection = MarshallerCollection()
  File "C:\Python310\lib\site-packages\hdf5storage\__init__.py", line 902, in __init__
    self._builtin_marshallers = [m() for key, m in dict(
  File "C:\Python310\lib\site-packages\hdf5storage\__init__.py", line 902, in <listcomp>
    self._builtin_marshallers = [m() for key, m in dict(
TypeError: Version.__init__() missing 1 required positional argument: 'version'

Curiously, this already seems to be fixed in the main branch: https://github.com/frejanordsiek/hdf5storage/blob/main/hdf5storage/__init__.py#L1115

Would it be possible to have a new hdf5storage release that includes this fix?

Thanks a lot!

frejanordsiek commented 1 year ago

It is now fixed in commit b223ff7212c12b9e7ad920906e2faf3081e06881. It was caused by very primitive collection of the Marshallers (collecting everything that is a class)

I will be pushing a 0.1.19 bugfix release to PyPI shortly.

joerg-tt commented 1 year ago

Thanks!