Update Python tools

This commit is contained in:
ajp_anton
2026-08-09 05:06:33 +00:00
parent 6d28257b54
commit 0dfb493ae1
3 changed files with 18 additions and 6 deletions
+8 -3
View File
@@ -144,8 +144,14 @@ class TaskCatalog:
group_path,
{path.name for path in task_paths},
)
paths_by_filename = {path.name: path for path in task_paths}
ordered_filenames = [
*declarations_by_filename,
*(path.name for path in task_paths if path.name not in declarations_by_filename),
]
tasks = []
for path in task_paths:
for filename in ordered_filenames:
path = paths_by_filename[filename]
declaration = declarations_by_filename.get(path.name)
tasks.append(
Task(
@@ -289,11 +295,10 @@ def parse_task_declaration(
) -> TaskDeclaration:
if (
not isinstance(declaration, dict)
or not {"inputs"} <= set(declaration)
or set(declaration) - {"inputs", "wait_for_result", "download_artifacts"}
):
raise ValueError(f"{manifest_path} task {filename} has an invalid declaration.")
raw_inputs = declaration["inputs"]
raw_inputs = declaration.get("inputs", [])
if not isinstance(raw_inputs, list):
raise ValueError(f"{manifest_path} task {filename} inputs must be a list.")
fields = tuple(parse_input_field(manifest_path, filename, raw) for raw in raw_inputs)