From 723705b94fc8c8006c6c1ca73181efdf70850033 Mon Sep 17 00:00:00 2001 From: Boming Zhang Date: Thu, 27 Feb 2025 01:17:14 -0500 Subject: [PATCH] fix: store path for both conf objs --- joj3_config_generator/main.py | 2 ++ joj3_config_generator/models/task.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/joj3_config_generator/main.py b/joj3_config_generator/main.py index eaf9c04..cf522c9 100644 --- a/joj3_config_generator/main.py +++ b/joj3_config_generator/main.py @@ -75,6 +75,8 @@ def convert( repo_conf.root = root repo_conf.path = repo_toml_path.relative_to(root) task_conf = task.Config(**task_obj) + task_conf.root = root + task_conf.path = task_toml_path.relative_to(root) result_model = convert_conf(repo_conf, task_conf) result_dict = result_model.model_dump(by_alias=True, exclude_none=True) with result_json_path.open("w") as result_file: diff --git a/joj3_config_generator/models/task.py b/joj3_config_generator/models/task.py index ab15bf7..6672d02 100644 --- a/joj3_config_generator/models/task.py +++ b/joj3_config_generator/models/task.py @@ -33,7 +33,8 @@ class Release(BaseModel): class Config(BaseModel): - path: Path = Path(".") + root: Path = Path(".") + path: Path = Path("conf.toml") task: str # Task name (e.g., hw3 ex5) release: Release # Release configuration stages: List[Stage] # list of stage configurations