PAHFIT / pahfit

Model Decomposition for Near- to Mid-Infrared Spectroscopy of Astronomical Sources
https://pahfit.readthedocs.io/
18 stars 26 forks source link

Use importlib.resources instead of pkg_resources (from setuptools) #278

Closed drvdputt closed 2 months ago

drvdputt commented 2 months ago

This seems to work fine to resolve #277 . Let's see what the tests do.

drvdputt commented 2 months ago

In addition to the pull requests planned in #280 , can we pull this one in first?

jdtsmith commented 2 months ago

I know very little about packaging, but happy to merge this. Can you target this to the dev branch, which I just created as a clean branch from master?

drvdputt commented 2 months ago

The issue here is that we were using a packaging tool (always had to pip install setuptools) to deal with the import of our resource files (the example spectra and included science packs).

This was never a problem with the automated tests, since they seem to always have setuptools in their environment. This is why we never included setuptools as a dependency. So when setting up a virtual environment with python3 -m venv venv_name, it is not always guaranteed that setuptools is present.

With these changes, we use the native importlib, so one less dependency. I think we can merge this into dev. If any thing breaks, I'm sure all the other testing during development will reveal it.

jdtsmith commented 2 months ago

Great done. I'm pretty ignorant on all the flavors of setup* stuff. I can at least pip install a local directory though ;).