From ddd6b68ac20e228793af3f1e69c6faf9f2f0ce0a Mon Sep 17 00:00:00 2001 From: Marcell Douglas Nagy <133755508+marcelldls@users.noreply.github.com> Date: Tue, 3 Dec 2024 17:11:28 +0000 Subject: [PATCH] Ignore return type hint (#97) --- src/fastcs/launch.py | 2 ++ tests/test_launch.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fastcs/launch.py b/src/fastcs/launch.py index d3d3fcf7..80c23515 100644 --- a/src/fastcs/launch.py +++ b/src/fastcs/launch.py @@ -160,6 +160,8 @@ def _extract_options_model(controller_class: type[Controller]) -> type[BaseModel ) elif len(args) == 2: hints = get_type_hints(controller_class.__init__) + if "return" in hints: + del hints["return"] if hints: options_type = list(hints.values())[-1] else: diff --git a/tests/test_launch.py b/tests/test_launch.py index e703fcba..52e23a39 100644 --- a/tests/test_launch.py +++ b/tests/test_launch.py @@ -27,7 +27,7 @@ def __init__(self, arg): class IsHinted(Controller): - def __init__(self, arg: SomeConfig): + def __init__(self, arg: SomeConfig) -> None: super().__init__()