Compare commits
	
		
			4 Commits
		
	
	
		
			1a1ed96c23
			...
			adfdc027f2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| adfdc027f2 | |||
| aee123601f | |||
| ae77fa23b5 | |||
| 870f20dde9 | 
| 
						 | 
				
			
			@ -109,7 +109,7 @@ class Task(BaseModel):
 | 
			
		|||
 | 
			
		||||
class Config(BaseModel):
 | 
			
		||||
    root: Path = Path(".")
 | 
			
		||||
    path: Path = Path("conf.toml")
 | 
			
		||||
    task: Task
 | 
			
		||||
    path: Path = Path("task.toml")
 | 
			
		||||
    task: Task  # Task name (e.g., hw3 ex5)
 | 
			
		||||
    release: Release  # Release configuration
 | 
			
		||||
    stages: List[Stage]  # list of stage configurations
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,15 +11,15 @@ from joj3_config_generator.models import repo, task
 | 
			
		|||
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"
 | 
			
		||||
    root = Path(__file__).resolve().parent / case_name
 | 
			
		||||
    repo_toml_path = root / "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 / "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 / "task.json").read_text())
 | 
			
		||||
    return (
 | 
			
		||||
        repo.Config(**rtoml.loads(repo_toml)),
 | 
			
		||||
        task.Config(**rtoml.loads(task_toml)),
 | 
			
		||||
        repo.Config(root=root, **rtoml.loads(repo_toml)),
 | 
			
		||||
        task.Config(root=root, **rtoml.loads(task_toml)),
 | 
			
		||||
        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