fix: merge master
This commit is contained in:
		
						commit
						adfdc027f2
					
				|  | @ -109,7 +109,7 @@ class Task(BaseModel): | ||||||
| 
 | 
 | ||||||
| class Config(BaseModel): | class Config(BaseModel): | ||||||
|     root: Path = Path(".") |     root: Path = Path(".") | ||||||
|     path: Path = Path("conf.toml") |     path: Path = Path("task.toml") | ||||||
|     task: Task |     task: Task  # Task name (e.g., hw3 ex5) | ||||||
|     release: Release  # Release configuration |     release: Release  # Release configuration | ||||||
|     stages: List[Stage]  # list of stage configurations |     stages: List[Stage]  # list of stage configurations | ||||||
|  |  | ||||||
|  | @ -11,15 +11,15 @@ from joj3_config_generator.models import repo, task | ||||||
| def read_convert_files( | def read_convert_files( | ||||||
|     case_name: str, |     case_name: str, | ||||||
| ) -> Tuple[repo.Config, task.Config, Dict[str, Any]]: | ) -> Tuple[repo.Config, task.Config, Dict[str, Any]]: | ||||||
|     root = Path(__file__).resolve().parent |     root = Path(__file__).resolve().parent / case_name | ||||||
|     repo_toml_path = root.absolute() / case_name / "repo.toml" |     repo_toml_path = root / "repo.toml" | ||||||
|     repo_toml = repo_toml_path.read_text() if repo_toml_path.exists() else "" |     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 / "task.toml" | ||||||
|     task_toml = task_toml_path.read_text() if task_toml_path.exists() else "" |     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 / "task.json").read_text()) | ||||||
|     return ( |     return ( | ||||||
|         repo.Config(**rtoml.loads(repo_toml)), |         repo.Config(root=root, **rtoml.loads(repo_toml)), | ||||||
|         task.Config(**rtoml.loads(task_toml)), |         task.Config(root=root, **rtoml.loads(task_toml)), | ||||||
|         result, |         result, | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,7 +0,0 @@ | ||||||
| from typing import Any |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| def safe_id(x: Any) -> str: |  | ||||||
|     if not x or not isinstance(x, (tuple, list)) or len(x) == 0: |  | ||||||
|         return "no_test_cases" |  | ||||||
|     return str(x[0]) |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user