mir-dataset-loaders / mirdata

Python library for working with Music Information Retrieval datasets
https://mirdata.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
351 stars 59 forks source link

Python 3.12 support #627

Open hyve9 opened 3 months ago

hyve9 commented 3 months ago

It looks like mirdata still depends on imp, which was deprecated in 3.11 and removed in 3.12:

pip install mirdata 
Collecting mirdata
  Using cached mirdata-0.3.8-py3-none-any.whl.metadata (6.6 kB)
Collecting attrs>=23.1.0 (from mirdata)
  Using cached attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
Collecting black>=23.3.0 (from mirdata)
  Using cached black-24.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (75 kB)
Collecting chardet>=5.0.0 (from mirdata)
  Using cached chardet-5.2.0-py3-none-any.whl.metadata (3.4 kB)
Collecting Deprecated>=1.2.14 (from mirdata)
  Using cached Deprecated-1.2.14-py2.py3-none-any.whl.metadata (5.4 kB)
Collecting jams>=0.3.4 (from mirdata)
  Using cached jams-0.3.4.tar.gz (51 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-gavk7r0k/jams_b471981ad2754869a2455feefe6ac42e/setup.py", line 3, in <module>
          import imp
      ModuleNotFoundError: No module named 'imp'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Recommend to replace imp with importlib: https://docs.python.org/3/library/importlib.html#module-importlib

hyve9 commented 3 months ago

Actually, it's not mirdata - mirdata already supports 3.12. It's Jams (https://github.com/marl/jams). This PR should resolve: https://github.com/marl/jams/pull/215