Repository navigation
v0.2.0 broke astropy #41
Copy link
Copy link
Closed
Labels
Description
Started getting weird errors with v0.2.0 that do not appear when using older version v0.1.2. Maybe some of those astropy specific code wasn't meant to be removed. If we cannot figure this out, I might need to yank v0.2.0 from PyPI.
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/runner/work/astropy/astropy/astropy/__init__.py", line 144, in _initialize_astropy
INTERNALERROR> from .utils import _compiler # noqa: F401
INTERNALERROR> ImportError: cannot import name '_compiler' from 'astropy.utils' (/home/runner/work/astropy/astropy/astropy/utils/__init__.py)
INTERNALERROR>
INTERNALERROR> During handling of the above exception, another exception occurred:
INTERNALERROR>
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/home/runner/work/astropy/astropy/.tox/py310-test-cov/lib/python3.10/site-packages/_pytest/main.py", line 265, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/home/runner/work/astropy/astropy/.tox/py310-test-cov/lib/python3.10/site-packages/_pytest/config/__init__.py", line 982, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "/home/runner/work/astropy/astropy/.tox/py310-test-cov/lib/python3.10/site-packages/pluggy/_hooks.py", line 277, in call_historic
INTERNALERROR> res = self._hookexec(self.name, self.get_hookimpls(), kwargs, False)
INTERNALERROR> File "/home/runner/work/astropy/astropy/.tox/py310-test-cov/lib/python3.10/site-packages/pluggy/_manager.py", line 80, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR> File "/home/runner/work/astropy/astropy/.tox/py310-test-cov/lib/python3.10/site-packages/pluggy/_callers.py", line 60, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/home/runner/work/astropy/astropy/.tox/py310-test-cov/lib/python3.10/site-packages/pluggy/_result.py", line 60, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/home/runner/work/astropy/astropy/.tox/py310-test-cov/lib/python3.10/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/home/runner/work/astropy/astropy/conftest.py", line 20, in pytest_configure
INTERNALERROR> from astropy import __version__
INTERNALERROR> File "/home/runner/work/astropy/astropy/astropy/__init__.py", line 177, in <module>
INTERNALERROR> _initialize_astropy()
INTERNALERROR> File "/home/runner/work/astropy/astropy/astropy/__init__.py", line 147, in _initialize_astropy
INTERNALERROR> raise ImportError('You appear to be trying to import astropy from '
INTERNALERROR> ImportError: You appear to be trying to import astropy from within a source checkout or from an editable installation without building the extension modules first. Either run:
INTERNALERROR>
INTERNALERROR> pip install -e .
INTERNALERROR>
INTERNALERROR> or
INTERNALERROR>
INTERNALERROR> python setup.py build_ext --inplace
INTERNALERROR>
INTERNALERROR> to make sure the extension modules are built
Any ideas, @astrofrog, @bsipocz , or @saimn ?
Reactions are currently unavailable
Activity
pllim commentedon Dec 29, 2021
Comment from @saimn below:
pytest-astropy-headerwas importingastropy, which avoided thig bug (inastropy). When we runpytestfromastropy/.tmp/<envname>it goes up and findsastropy/conftest.pyso it wants to import it. To do so it modifies the path, adding temporarily the local checkout directory tosys.path. The local checkout does not have the compiled extensions so it fails to import_compiler. But before, sinceastropywas imported first frompytest-astropy-header, the path wasn't modified andastropywas correctly imported fromsite-packages. And since imports are cached, theastropyimport triggered byastropy/conftest.pywasn't failing!