Add YAPF style + ignore, and format tracked Python files
This commit is contained in:
@@ -56,17 +56,19 @@ class PipelineRunResult:
|
||||
def to_summary(self) -> Dict[str, Any]:
|
||||
"""Provide a JSON-friendly representation for logging or UI."""
|
||||
return {
|
||||
"pipeline": self.pipeline,
|
||||
"success": self.success,
|
||||
"error": self.error,
|
||||
"pipeline":
|
||||
self.pipeline,
|
||||
"success":
|
||||
self.success,
|
||||
"error":
|
||||
self.error,
|
||||
"stages": [
|
||||
{
|
||||
"name": stage.name,
|
||||
"status": stage.status,
|
||||
"error": stage.error,
|
||||
"emitted": len(stage.emitted),
|
||||
}
|
||||
for stage in self.stages
|
||||
} for stage in self.stages
|
||||
],
|
||||
}
|
||||
|
||||
@@ -89,7 +91,8 @@ class PipelineRunner:
|
||||
*,
|
||||
seeds: Optional[Any] = None,
|
||||
isolate: bool = False,
|
||||
on_log: Optional[Callable[[str], None]] = None,
|
||||
on_log: Optional[Callable[[str],
|
||||
None]] = None,
|
||||
) -> PipelineRunResult:
|
||||
snapshot: Optional[Dict[str, Any]] = None
|
||||
if isolate:
|
||||
@@ -102,7 +105,7 @@ class PipelineRunner:
|
||||
return result
|
||||
|
||||
try:
|
||||
from cli_syntax import validate_pipeline_text
|
||||
from SYS.cli_syntax import validate_pipeline_text
|
||||
|
||||
syntax_error = validate_pipeline_text(normalized)
|
||||
if syntax_error:
|
||||
@@ -151,8 +154,8 @@ class PipelineRunner:
|
||||
try:
|
||||
with capture_rich_output(stdout=stdout_buffer, stderr=stderr_buffer):
|
||||
with (
|
||||
contextlib.redirect_stdout(stdout_buffer),
|
||||
contextlib.redirect_stderr(stderr_buffer),
|
||||
contextlib.redirect_stdout(stdout_buffer),
|
||||
contextlib.redirect_stderr(stderr_buffer),
|
||||
):
|
||||
if on_log:
|
||||
on_log("Executing pipeline via CLI executor...")
|
||||
@@ -171,8 +174,7 @@ class PipelineRunner:
|
||||
table = None
|
||||
try:
|
||||
table = (
|
||||
ctx.get_display_table()
|
||||
or ctx.get_current_stage_table()
|
||||
ctx.get_display_table() or ctx.get_current_stage_table()
|
||||
or ctx.get_last_result_table()
|
||||
)
|
||||
except Exception:
|
||||
@@ -234,7 +236,8 @@ class PipelineRunner:
|
||||
return val.copy()
|
||||
return val
|
||||
|
||||
snap: Dict[str, Any] = {}
|
||||
snap: Dict[str,
|
||||
Any] = {}
|
||||
keys = [
|
||||
"_LIVE_PROGRESS",
|
||||
"_CURRENT_CONTEXT",
|
||||
@@ -269,11 +272,13 @@ class PipelineRunner:
|
||||
snap["_RESULT_TABLE_HISTORY"] = [
|
||||
(
|
||||
t,
|
||||
(items.copy() if isinstance(items, list) else list(items) if items else []),
|
||||
(
|
||||
items.copy()
|
||||
if isinstance(items,
|
||||
list) else list(items) if items else []
|
||||
),
|
||||
subj,
|
||||
)
|
||||
for (t, items, subj) in hist
|
||||
if isinstance((t, items, subj), tuple)
|
||||
) for (t, items, subj) in hist if isinstance((t, items, subj), tuple)
|
||||
]
|
||||
except Exception:
|
||||
pass
|
||||
@@ -283,11 +288,13 @@ class PipelineRunner:
|
||||
snap["_RESULT_TABLE_FORWARD"] = [
|
||||
(
|
||||
t,
|
||||
(items.copy() if isinstance(items, list) else list(items) if items else []),
|
||||
(
|
||||
items.copy()
|
||||
if isinstance(items,
|
||||
list) else list(items) if items else []
|
||||
),
|
||||
subj,
|
||||
)
|
||||
for (t, items, subj) in fwd
|
||||
if isinstance((t, items, subj), tuple)
|
||||
) for (t, items, subj) in fwd if isinstance((t, items, subj), tuple)
|
||||
]
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user