Open moemyself3 opened 9 months ago
yeah, the way I'd like to do it is:
try:
import imp
except ImportError:
import importlib as imp
A PR is welcome, though!
Ohh indeed! Much better since it preserves older python.
Hmm I cracked this open a bit further. I made the change on your code, but now it falls on the deprecated and archived astropy_helpers/astropy_helpers/utils.py
:
seems like it'll continue to fail unless the use is changed in the helpers as well. I'll try it out to see if we can get it to work.
Yeah, I need to replace astropy-helpers entirely; that whole package is deprecated. If you want to give it a go, I'd be happy to merge that.
I was able to make changes in the astropy-helpers package to the point that I was able to install FITS_tools locally using pip.
Essentially the import_file()
method needed to be updated using importlib
. That being said, I'm at the edge of my knowledge with git and submodules. I made the commit of changes to astropy-helpers on my local fork of FITS_tools and realized that the changes are not preserved. When I check the commit to changes on astropy-helpers it point to a 404.
I am assuming the way to make this work is to fork the astropy-helpers make changes to my fork and link the submodule to that one instead.
Let me know what you think. I know this is really just a stopgap until astropy-helpers can be replaced.
Actually, the best thing is just to totally remove astropy-helpers.... we've done this before in, e.g., https://github.com/radio-astro-tools/spectral-cube/pull/599
I've overhauled setup.py
and made a PR (https://github.com/keflavich/FITS_tools/pull/17) to address this issue. @keflavich, can you double-check to see if I'm missing anything, including if setup.cfg
is still needed? I haven't had issues with this implementation so far.
If this is good, I think we can safely remove ah_bootstrap.py
as well.
I was running some code that called FITS_tools and found that
imp
has been deprecated in python 3.12.I see that the only method called is
imp.reload
so you may be able to swap it forimportlib.reload
(introduced python 3.1)https://github.com/keflavich/FITS_tools/blob/80616e3301931e3157d54738a9c63ac03c0172f5/ah_bootstrap.py#L36
I can start a pull request if you'd like.