Compare commits

..

No commits in common. "1a1ed96c238317a8707023ffe3255e0cfc36355b" and "99ccbbd113a0bb3ab88b31c6fd4a127be646a3a8" have entirely different histories.

4 changed files with 8 additions and 12 deletions

View File

@ -73,11 +73,9 @@ def convert(
)
task_obj = rtoml.loads(task_toml_path.read_text())
repo_conf = repo.Config(**repo_obj)
repo_conf.root = root
repo_conf.path = repo_toml_path.relative_to(root)
repo_conf.path = (root / repo_toml_path.relative_to(root)).resolve()
task_conf = task.Config(**task_obj)
task_conf.root = root
task_conf.path = task_toml_path.relative_to(root)
task_conf.path = (root / task_toml_path.relative_to(root)).resolve()
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:

View File

@ -22,5 +22,4 @@ class Config(BaseModel):
max_total_score: int = Field(100)
force_skip_heatlh_check_on_test: bool = False
groups: Groups = Groups()
root: Path = Path(".")
path: Path = Path("repo.toml")
path: Path = Path(".")

View File

@ -108,8 +108,7 @@ class Task(BaseModel):
class Config(BaseModel):
root: Path = Path(".")
path: Path = Path("conf.toml")
task: Task
release: Release # Release configuration
release: Release
path: Path = Path(".")
stages: List[Stage] # list of stage configurations

View File

@ -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.absolute() / case_name / "repo.toml"
repo_toml_path = root / case_name / "repo.toml"
repo_toml = repo_toml_path.read_text() if repo_toml_path.exists() else ""
task_toml_path = root.absolute() / case_name / "task.toml"
task_toml_path = root / case_name / "task.toml"
task_toml = task_toml_path.read_text() if task_toml_path.exists() else ""
result = json.loads((root.absolute() / case_name / "task.json").read_text())
result = json.loads((root / case_name / "task.json").read_text())
return (
repo.Config(**rtoml.loads(repo_toml)),
task.Config(**rtoml.loads(task_toml)),