martinlarsalbert
01/20/2022, 9:47 AManyconfig
as a backend.
Args:
config_file: Path to a config file to process.
Returns:
Parsed configuration.
"""
# for performance reasons
import anyconfig # pylint: disable=import-outside-toplevel
if "globals" in str(config_file):
globals = {}
else:
globals_pattern = "*globals.yml"
globals = self.get(globals_pattern) if globals_pattern else {}
return {
k: v
for k, v in anyconfig.load(
config_file, ac_template=True, ac_context=globals
).items()
if not k.startswith("_")
}
```