From f09d179b7b11f6a1545c80f775ed42911dae4ae5 Mon Sep 17 00:00:00 2001 From: miguelgfierro Date: Thu, 28 May 2026 15:33:51 +0200 Subject: [PATCH] fix(ci): satisfy stricter ruff rules on PR gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three Ruff rules that the project ruff CI enforces but my local ruff missed (newer CI version): - SIM103 in engine.py:_is_send_payload — collapse the second if/return pair into a direct return. - F841 in test_pipeline_engine_pause_send.py — remove an unused 'planner' variable that was leftover from an earlier draft of test_single_send_is_treated_as_list_of_one. - N817 in same test file — rename 'Pause as P' / 'Send as S' to 'PausePkg'/'SendPkg' (single-letter CamelCase aliases trip the acronym rule). No behavior change. Tests still 7/7 in that file. --- fireflyframework_agentic/pipeline/engine.py | 4 +--- .../unit/pipeline/test_pipeline_engine_pause_send.py | 12 +++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/fireflyframework_agentic/pipeline/engine.py b/fireflyframework_agentic/pipeline/engine.py index cea10b14..8317e5b1 100644 --- a/fireflyframework_agentic/pipeline/engine.py +++ b/fireflyframework_agentic/pipeline/engine.py @@ -193,9 +193,7 @@ def _is_send_payload(value: Any) -> bool: """ if isinstance(value, Send): return True - if isinstance(value, list) and value and all(isinstance(s, Send) for s in value): - return True - return False + return isinstance(value, list) and bool(value) and all(isinstance(s, Send) for s in value) def _serialize_value(value: Any) -> Any: diff --git a/tests/unit/pipeline/test_pipeline_engine_pause_send.py b/tests/unit/pipeline/test_pipeline_engine_pause_send.py index f4526e15..32e56c85 100644 --- a/tests/unit/pipeline/test_pipeline_engine_pause_send.py +++ b/tests/unit/pipeline/test_pipeline_engine_pause_send.py @@ -161,9 +161,7 @@ async def test_send_dispatches_workers_concurrently(): async def test_single_send_is_treated_as_list_of_one(): - planner = _step_emit_sends(["a"]) - # Override to emit a single Send (not a list). - + # A planner step that emits one Send directly (not wrapped in a list). class _Solo: async def execute(self, ctx, inputs): return Send(target="a", payload={"items": ["just-a"]}) @@ -196,8 +194,8 @@ async def execute(self, ctx, inputs): def test_pause_and_send_reexported_from_pipeline_package(): - from fireflyframework_agentic.pipeline import Pause as P - from fireflyframework_agentic.pipeline import Send as S + from fireflyframework_agentic.pipeline import Pause as PausePkg + from fireflyframework_agentic.pipeline import Send as SendPkg - assert P is Pause - assert S is Send + assert PausePkg is Pause + assert SendPkg is Send