From 858b46e1c2a2d55ce99d98934f2b3515efb0d140 Mon Sep 17 00:00:00 2001 From: Chandrasekharan M Date: Tue, 17 Sep 2024 12:57:44 +0530 Subject: [PATCH] Minor log enhancement - tool version included --- src/unstract/sdk/tool/entrypoint.py | 5 ----- src/unstract/sdk/tool/executor.py | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/unstract/sdk/tool/entrypoint.py b/src/unstract/sdk/tool/entrypoint.py index d96a8c7f..347c3d3a 100644 --- a/src/unstract/sdk/tool/entrypoint.py +++ b/src/unstract/sdk/tool/entrypoint.py @@ -1,6 +1,3 @@ -import os - -from unstract.sdk.constants import ToolEnv from unstract.sdk.tool.base import BaseTool from unstract.sdk.tool.executor import ToolExecutor from unstract.sdk.tool.parser import ToolArgsParser @@ -20,8 +17,6 @@ def launch(tool: BaseTool, args: list[str]) -> None: tool (AbstractTool): Tool to execute args (List[str]): Arguments passed to a tool """ - # Implicitly set to indicate that the SDK is run from a tool - os.environ[ToolEnv.EXECUTION_BY_TOOL] = "True" parsed_args = ToolArgsParser.parse_args(args) executor = ToolExecutor(tool=tool) executor.execute(parsed_args) diff --git a/src/unstract/sdk/tool/executor.py b/src/unstract/sdk/tool/executor.py index 603a4ab5..e2eb2fca 100644 --- a/src/unstract/sdk/tool/executor.py +++ b/src/unstract/sdk/tool/executor.py @@ -50,8 +50,9 @@ def execute_run(self, args: argparse.Namespace) -> None: settings: dict[str, Any] = loads(args.settings) tool_name = self.tool.properties["displayName"] + tool_version = self.tool.properties["toolVersion"] self.tool.stream_log( - f"Running tool '{tool_name}' with " + f"Running tool '{tool_name}:{tool_version}' with " f"Workflow ID: {self.tool.workflow_id}, " f"Execution ID: {self.tool.execution_id}, " f"SDK Version: {get_sdk_version()}"