"""Icarus configuration modules.
Re-exports everything from the parent config.py module so that
from icarus.core.config import X still works even though this
directory also exists as a package.
This package also contains environment-specific overrides (staging.py).
"""
import importlib.util
import os
from pathlib import Path
Load the parent config.py module directly and re-export all public names
_config_path = Path(file).resolve().parent.parent / "config.py"
if _config_path.exists():
_spec = importlib.util.spec_from_file_location("_icarus_config", str(_config_path))
_config_module = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(_config_module)
# Re-export all public names from config.py
_public_names = [name for name in dir(_config_module) if not name.startswith("_")]
for _name in _public_names:
globals()[_name] = getattr(_config_module, _name)
__all__ = _public_names
else:
all = []
version = "0.0.1"