From d014dd35dc0858e18b1c14c1c98868329202f075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sun, 17 Jul 2022 10:41:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Fix=20type=20annotations=20for?= =?UTF-8?q?=20`get=5Fgroup`=20(#430)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typer/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/typer/main.py b/typer/main.py index 2db0a62..8aa1cf9 100644 --- a/typer/main.py +++ b/typer/main.py @@ -328,7 +328,7 @@ class Typer: raise e -def get_group(typer_instance: Typer) -> click.Command: +def get_group(typer_instance: Typer) -> TyperGroup: group = get_group_from_info( TyperInfo(typer_instance), pretty_exceptions_short=typer_instance.pretty_exceptions_short, @@ -347,7 +347,7 @@ def get_command(typer_instance: Typer) -> click.Command: or len(typer_instance.registered_commands) > 1 ): # Create a Group - click_command = get_group(typer_instance) + click_command: click.Command = get_group(typer_instance) if typer_instance._add_completion: click_command.params.append(click_install_param) click_command.params.append(click_show_param) @@ -474,7 +474,7 @@ def get_group_from_info( *, pretty_exceptions_short: bool, rich_markup_mode: MarkupMode, -) -> click.Command: +) -> TyperGroup: assert ( group_info.typer_instance ), "A Typer instance is needed to generate a Click Group"