diff --git a/regions/__init__.py b/regions/__init__.py index 8f5dcb73..f31efac0 100644 --- a/regions/__init__.py +++ b/regions/__init__.py @@ -16,9 +16,7 @@ from ._astropy_init import * # ---------------------------------------------------------------------------- -# For egg_info test builds to pass, put package imports here. -if not _ASTROPY_SETUP_: - from ._utils.examples import * - from .core import * - from .shapes import * - from .io import * +from ._utils.examples import * # noqa +from .core import * # noqa +from .shapes import * # noqa +from .io import * # noqa diff --git a/regions/_astropy_init.py b/regions/_astropy_init.py index fa37a637..bd453245 100644 --- a/regions/_astropy_init.py +++ b/regions/_astropy_init.py @@ -1,25 +1,13 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst +import os -__all__ = ['__version__'] - -# this indicates whether or not we are in the package's setup.py -try: - _ASTROPY_SETUP_ -except NameError: - import builtins - builtins._ASTROPY_SETUP_ = False +__all__ = ['__version__', 'test'] try: from .version import version as __version__ except ImportError: __version__ = '' - -if not _ASTROPY_SETUP_: # noqa - import os - - # Create the test function for self test - from astropy.tests.runner import TestRunner - test = TestRunner.make_test_runner_in(os.path.dirname(__file__)) - test.__test__ = False - __all__ += ['test'] +# Create the test function for self test +from astropy.tests.runner import TestRunner +test = TestRunner.make_test_runner_in(os.path.dirname(__file__))