Remove args/kwargs being passed to generated Action from FactoryAction

This commit is contained in:
Roland Thomas Jr 2025-05-21 23:35:57 -04:00
parent b51ba87999
commit 0a1ba22a3d
Signed by: roland
GPG Key ID: 7C3C2B085A4C2872
3 changed files with 5 additions and 3 deletions

View File

@ -63,6 +63,8 @@ class ActionFactoryAction(BaseAction):
return self.factory, None return self.factory, None
async def _run(self, *args, **kwargs) -> Any: async def _run(self, *args, **kwargs) -> Any:
args = (*self.args, *args)
kwargs = {**self.kwargs, **kwargs}
updated_kwargs = self._maybe_inject_last_result(kwargs) updated_kwargs = self._maybe_inject_last_result(kwargs)
context = ExecutionContext( context = ExecutionContext(
name=f"{self.name} (factory)", name=f"{self.name} (factory)",
@ -92,7 +94,7 @@ class ActionFactoryAction(BaseAction):
) )
if self.options_manager: if self.options_manager:
generated_action.set_options_manager(self.options_manager) generated_action.set_options_manager(self.options_manager)
context.result = await generated_action(*args, **kwargs) context.result = await generated_action()
await self.hooks.trigger(HookType.ON_SUCCESS, context) await self.hooks.trigger(HookType.ON_SUCCESS, context)
return context.result return context.result
except Exception as error: except Exception as error:

View File

@ -1 +1 @@
__version__ = "0.1.31" __version__ = "0.1.32"

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "falyx" name = "falyx"
version = "0.1.31" version = "0.1.32"
description = "Reliable and introspectable async CLI action framework." description = "Reliable and introspectable async CLI action framework."
authors = ["Roland Thomas Jr <roland@rtj.dev>"] authors = ["Roland Thomas Jr <roland@rtj.dev>"]
license = "MIT" license = "MIT"