refactor/main #11
|
@ -73,9 +73,11 @@ def convert(
|
|||
)
|
||||
task_obj = rtoml.loads(task_toml_path.read_text())
|
||||
repo_conf = repo.Config(**repo_obj)
|
||||
repo_conf.path = (root / repo_toml_path.relative_to(root)).resolve()
|
||||
repo_conf.root = root
|
||||
|
||||
repo_conf.path = repo_toml_path.relative_to(root)
|
||||
task_conf = task.Config(**task_obj)
|
||||
李衍志523370910113
commented
`task_conf.path` as absolute
|
||||
task_conf.path = (root / task_toml_path.relative_to(root)).resolve()
|
||||
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:
|
||||
|
|
|
@ -22,4 +22,5 @@ class Config(BaseModel):
|
|||
max_total_score: int = Field(100)
|
||||
force_skip_heatlh_check_on_test: bool = False
|
||||
groups: Groups = Groups()
|
||||
path: Path = Path(".")
|
||||
root: Path = Path(".")
|
||||
path: Path = Path("repo.toml")
|
||||
|
|
|
@ -108,7 +108,8 @@ class Task(BaseModel):
|
|||
|
||||
|
||||
class Config(BaseModel):
|
||||
root: Path = Path(".")
|
||||
path: Path = Path("conf.toml")
|
||||
task: Task
|
||||
release: Release
|
||||
path: Path = Path(".")
|
||||
release: Release # Release configuration
|
||||
stages: List[Stage] # list of stage configurations
|
||||
|
|
|
@ -12,11 +12,11 @@ def read_convert_files(
|
|||
case_name: str,
|
||||
) -> Tuple[repo.Config, task.Config, Dict[str, Any]]:
|
||||
root = Path(__file__).resolve().parent
|
||||
repo_toml_path = root / case_name / "repo.toml"
|
||||
repo_toml_path = root.absolute() / case_name / "repo.toml"
|
||||
repo_toml = repo_toml_path.read_text() if repo_toml_path.exists() else ""
|
||||
task_toml_path = root / case_name / "task.toml"
|
||||
task_toml_path = root.absolute() / case_name / "task.toml"
|
||||
task_toml = task_toml_path.read_text() if task_toml_path.exists() else ""
|
||||
result = json.loads((root / case_name / "task.json").read_text())
|
||||
result = json.loads((root.absolute() / case_name / "task.json").read_text())
|
||||
return (
|
||||
repo.Config(**rtoml.loads(repo_toml)),
|
||||
task.Config(**rtoml.loads(task_toml)),
|
||||
|
|
Loading…
Reference in New Issue
Block a user
repo_conf.path
as absolute