Skip to content

Commit

Permalink
MNT: Remove unused astropy config code (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim authored Apr 19, 2021
1 parent 491bbf6 commit d5cda43
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions caldp/_astropy_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,12 @@
except ImportError:
__version__ = ""


if not _ASTROPY_SETUP_: # noqa
import os
from warnings import warn
from astropy.config.configuration import (
update_default_config,
ConfigurationDefaultMissingError,
ConfigurationDefaultMissingWarning,
)

# 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"]

# add these here so we only need to cleanup the namespace at the end
config_dir = None

if not os.environ.get("ASTROPY_SKIP_CONFIG_UPDATE", False):
config_dir = os.path.dirname(__file__)
config_template = os.path.join(config_dir, __package__ + ".cfg")
if os.path.isfile(config_template):
try:
update_default_config(__package__, config_dir, version=__version__)
except TypeError as orig_error:
try:
update_default_config(__package__, config_dir)
except ConfigurationDefaultMissingError as e:
wmsg = (
e.args[0] + " Cannot install default profile. If you are "
"importing from source, this is expected."
)
warn(ConfigurationDefaultMissingWarning(wmsg))
del e
except Exception:
raise orig_error

0 comments on commit d5cda43

Please sign in to comment.