Skip to content

v0.2.0 broke astropy #41

Closed
Closed

Description

@pllim

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 ?

xref astropy/astropy#12659

v0.1.2...v0.2.0

Activity

  1. added
    bugSomething isn't working
    🔥Critical
    on Dec 27, 2021
  2. pllim commented on Dec 29, 2021

    @pllim
    MemberAuthor

    Comment from @saimn below:

    pytest-astropy-header was importing astropy, which avoided thig bug (in astropy). When we run pytest from astropy/.tmp/<envname> it goes up and finds astropy/conftest.py so it wants to import it. To do so it modifies the path, adding temporarily the local checkout directory to sys.path. The local checkout does not have the compiled extensions so it fails to import _compiler. But before, since astropy was imported first from pytest-astropy-header, the path wasn't modified and astropy was correctly imported from site-packages. And since imports are cached, the astropy import triggered by astropy/conftest.py wasn't failing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔥CriticalbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions