desihub / desispec

DESI spectral pipeline
BSD 3-Clause "New" or "Revised" License
36 stars 24 forks source link

pkg_resources deprecated; use importlib.resources instead #2018

Closed sbailey closed 9 months ago

sbailey commented 1 year ago

We use pkg_resources in multiple places throughout the desi code repos, e.g. to find configuration files or yaml files for bitmasks. Apparently that is now deprecated; see https://setuptools.pypa.io/en/latest/pkg_resources.html, which I learned about from esheldon/fitsio#360

We don't get that message using our latest desiconda environment at NERSC (python 3.10.8 with setuptools 65.6.3).

The suggested alternative is importlib.resources

@weaverba137 heads up

moustakas commented 9 months ago

@sbailey I can take this ticket, but do you want me to wait until after #2154 and #2155 are merged since I'll be touching many of the same files?