From 60375ae4c6b1ee7d70a01457dc26a231b7a9f258 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Wed, 11 Dec 2024 10:11:06 -0800 Subject: [PATCH] fix override order in rail project configuration --- src/rail/utils/project.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rail/utils/project.py b/src/rail/utils/project.py index 790ec79..4e5ce93 100644 --- a/src/rail/utils/project.py +++ b/src/rail/utils/project.py @@ -53,13 +53,15 @@ def load_config(config_file: str) -> RailProject: """ Create and return a RailProject from a yaml config file""" project_name = Path(config_file).stem with open(config_file, "r", encoding='utf-8') as fp: - config_dict = yaml.safe_load(fp) - includes = config_dict.get('Includes', []) + config_orig = yaml.safe_load(fp) + includes = config_orig.get('Includes', []) + config_dict = {} # FIXME, make this recursive to allow for multiple layers of includes for include_ in includes: with open(include_, "r", encoding='utf-8') as fp: config_extra = yaml.safe_load(fp) name_utils.update_include_dict(config_dict, config_extra) + name_utils.update_include_dict(config_dict, config_orig) project = RailProject(project_name, config_dict) # project.resolve_common() return project