Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dependabot/pip/ruff-0.9.1' int…
Browse files Browse the repository at this point in the history
…o dependabot/pip/ruff-0.9.1
  • Loading branch information
svlandeg committed Jan 16, 2025
2 parents 4b8bc44 + d67862a commit e4f1a0e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions typer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,9 @@ def get_group_from_info(
pretty_exceptions_short: bool,
rich_markup_mode: MarkupMode,
) -> TyperGroup:
assert group_info.typer_instance, (
"A Typer instance is needed to generate a Click Group"
)
assert (
group_info.typer_instance
), "A Typer instance is needed to generate a Click Group"
commands: Dict[str, click.Command] = {}
for command_info in group_info.typer_instance.registered_commands:
command = get_command_from_info(
Expand Down Expand Up @@ -847,16 +847,16 @@ def get_click_param(
# Handle Tuples and Lists
if lenient_issubclass(origin, List):
main_type = get_args(main_type)[0]
assert not get_origin(main_type), (
"List types with complex sub-types are not currently supported"
)
assert not get_origin(
main_type
), "List types with complex sub-types are not currently supported"
is_list = True
elif lenient_issubclass(origin, Tuple): # type: ignore
types = []
for type_ in get_args(main_type):
assert not get_origin(type_), (
"Tuple types with complex sub-types are not currently supported"
)
assert not get_origin(
type_
), "Tuple types with complex sub-types are not currently supported"
types.append(
get_click_type(annotation=type_, parameter_info=parameter_info)
)
Expand Down

0 comments on commit e4f1a0e

Please sign in to comment.