From 0f1f438ec982cfa1e07388d70781b9fd48251ff4 Mon Sep 17 00:00:00 2001 From: woutdenolf Date: Fri, 10 Apr 2026 19:58:00 +0200 Subject: [PATCH] adapt to pypushflow 2.0 --- pyproject.toml | 2 +- src/ewoksppf/bindings.py | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 68b8d51..01fbe80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ requires-python = ">=3.8" dependencies = [ "ewokscore >=4.0.1", - "pypushflow >=1.1.0" + "pypushflow >=2.0.0rc1" ] [project.urls] diff --git a/src/ewoksppf/bindings.py b/src/ewoksppf/bindings.py index 15ec3f8..5044d84 100644 --- a/src/ewoksppf/bindings.py +++ b/src/ewoksppf/bindings.py @@ -1,5 +1,4 @@ import os -import pprint import warnings from contextlib import contextmanager from typing import Generator @@ -81,13 +80,13 @@ def __init__(self, node_id, node_attrs, **kw): kw["name"] = ppfname(node_id) super().__init__(**kw) - def trigger(self, inData: dict): + def _execute(self, inData: dict, _scope_id: Optional[str] = None) -> None: # Update the INFOKEY with node information infokey = ppfrunscript.INFOKEY inData[infokey] = dict(inData[infokey]) inData[infokey]["node_id"] = self.node_id inData[infokey]["node_attrs"] = self.node_attrs - return super().trigger(inData) + super()._execute(inData, _scope_id=_scope_id) def compileDownstreamData(self, result: dict) -> dict: # Merging inputs and outputs to trigger the next task @@ -152,8 +151,7 @@ def _conditions_fulfilled(self, inData: dict) -> bool: return False return True - def trigger(self, inData): - self.logger.info("triggered with inData =\n %s", pprint.pformat(inData)) + def _execute(self, inData: dict, _scope_id: Optional[str] = None) -> None: self.setStarted() trigger = self._conditions_fulfilled(inData) self.setFinished() @@ -187,8 +185,7 @@ def connect(self, actor): if isinstance(actor, InputMergeActor): actor.require_input_from_actor(self) - def trigger(self, inData: dict): - self.logger.info("triggered with inData =\n %s", pprint.pformat(inData)) + def _execute(self, inData: dict, _scope_id: Optional[str] = None) -> None: is_error = "WorkflowExceptionInstance" in inData and inData.get( "_NewWorkflowException" ) @@ -235,8 +232,9 @@ def require_input_from_actor(self, actor): if actor.required: self.requiredInData[actor] = None - def trigger(self, inData: dict, source=None): - self.logger.info("triggered with inData =\n %s", pprint.pformat(inData)) + def _execute( + self, inData: dict, _scope_id: Optional[str] = None, source=None + ) -> None: self.setStarted() self.setFinished() if source is None: