Skip to content

Commit

Permalink
fix override order in rail project configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
eacharles committed Dec 11, 2024
1 parent 19021e1 commit 60375ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rail/utils/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 60375ae

Please sign in to comment.