from __future__ import absolute_import

try:
    from .version import version as __version__
except ImportError:
    __version__ = ''

try:
    from .version import githash as __githash__
except ImportError:
    __githash__ = ''

import os
from sunpy.util.config import load_config, print_config
from sunpy.util import system_info
from sunpy.tests.runner import SunPyTestRunner

self_test = SunPyTestRunner.make_test_runner_in(os.path.dirname(__file__))

# Load user configuration
config = load_config()

__all__ = ['config', 'self_test', 'system_info']

from __future__ import absolute_import

try:
    from .version import version as __version__
except ImportError:
    __version__ = ''

try:
    from .version import githash as __githash__
except ImportError:
    __githash__ = ''

try:
    _ASTROPY_SETUP_
except NameError:
    _ASTROPY_SETUP_ = False


if not _ASTROPY_SETUP_:
    import os
    from sunpy.util.config import load_config, print_config
    from sunpy.util import system_info
    from sunpy.tests.runner import SunPyTestRunner

    self_test = SunPyTestRunner.make_test_runner_in(os.path.dirname(__file__))

    # Load user configuration
    config = load_config()

    __all__ = ['config', 'self_test', 'system_info']

Make sure package does not import itself during setup
Make sure package does not import itself during setup

  from __future__ import absolute_import
  
  try:
      from .version import version as __version__
  except ImportError:
      __version__ = ''
  
  try:
      from .version import githash as __githash__
  except ImportError:
      __githash__ = ''
  
- import os
- from sunpy.util.config import load_config, print_config
- from sunpy.util import system_info
- from sunpy.tests.runner import SunPyTestRunner
+ try:
+     _ASTROPY_SETUP_
+ except NameError:
+     _ASTROPY_SETUP_ = False
  
- self_test = SunPyTestRunner.make_test_runner_in(os.path.dirname(__file__))
  
- # Load user configuration
- config = load_config()
+ if not _ASTROPY_SETUP_:
+     import os
+     from sunpy.util.config import load_config, print_config
+     from sunpy.util import system_info
+     from sunpy.tests.runner import SunPyTestRunner
  
- __all__ = ['config', 'self_test', 'system_info']
+     self_test = SunPyTestRunner.make_test_runner_in(os.path.dirname(__file__))
  
+     # Load user configuration
+     config = load_config()
+ 
+     __all__ = ['config', 'self_test', 'system_info']
+ 
Make sure package does not import itself during setup
## Code Before:
from __future__ import absolute_import

try:
    from .version import version as __version__
except ImportError:
    __version__ = ''

try:
    from .version import githash as __githash__
except ImportError:
    __githash__ = ''

import os
from sunpy.util.config import load_config, print_config
from sunpy.util import system_info
from sunpy.tests.runner import SunPyTestRunner

self_test = SunPyTestRunner.make_test_runner_in(os.path.dirname(__file__))

# Load user configuration
config = load_config()

__all__ = ['config', 'self_test', 'system_info']

## Instruction:
Make sure package does not import itself during setup
## Code After:
from __future__ import absolute_import

try:
    from .version import version as __version__
except ImportError:
    __version__ = ''

try:
    from .version import githash as __githash__
except ImportError:
    __githash__ = ''

try:
    _ASTROPY_SETUP_
except NameError:
    _ASTROPY_SETUP_ = False


if not _ASTROPY_SETUP_:
    import os
    from sunpy.util.config import load_config, print_config
    from sunpy.util import system_info
    from sunpy.tests.runner import SunPyTestRunner

    self_test = SunPyTestRunner.make_test_runner_in(os.path.dirname(__file__))

    # Load user configuration
    config = load_config()

    __all__ = ['config', 'self_test', 'system_info']
