spedas / pyspedas

Python-based Space Physics Environment Data Analysis Software
https://pyspedas.readthedocs.io/
MIT License
143 stars 58 forks source link

Github tests fail for PySPEDAS with Python 3.12 #818

Closed jameswilburlewis closed 3 months ago

jameswilburlewis commented 3 months ago
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home/runner/work/pyspedas/pyspedas/pyspedas/__init__.py", line 15, in <module>
    from .cdagui.cdagui import cdagui
  File "/home/runner/work/pyspedas/pyspedas/pyspedas/cdagui/cdagui.py", line 23, in <module>
    from cdaweb import CDAWeb
  File "/home/runner/work/pyspedas/pyspedas/pyspedas/cdagui/cdaweb.py", line 14, in <module>
    from pyspedas.utilities.download import download
  File "/home/runner/work/pyspedas/pyspedas/pyspedas/utilities/download.py", line 8, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

Apparently the issue is that setuptools was deprecated in python 3.10 and removed in python 3.12. So we'll need to find a workaround.

jameswilburlewis commented 3 months ago

See: https://github.com/spedas/pyspedas/issues/639

We can fix the issue by getting the version string from importlib.metadata rather than pkg_resources.