From 193a875a8f9bf08f7732f9d5a44f0af355fa78e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:08:54 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=E2=AC=86=20Bump=20ruff=20from=200.8.6=20to?= =?UTF-8?q?=200.9.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [ruff](https://github.com/astral-sh/ruff) from 0.8.6 to 0.9.1. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.8.6...0.9.1) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-tests.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-tests.txt b/requirements-tests.txt index 22660e69fa..f461882321 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -6,7 +6,7 @@ coverage[toml] >=6.2,<8.0 pytest-xdist >=1.32.0,<4.0.0 pytest-sugar >=0.9.4,<1.1.0 mypy ==1.4.1 -ruff ==0.8.6 +ruff ==0.9.1 # Needed explicitly by typer-slim rich >=10.11.0 shellingham >=1.3.0 From 4bc628c03990eaf61d47ec5cb7f34bdc92be3698 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Thu, 16 Jan 2025 10:42:01 +0100 Subject: [PATCH 2/5] format main with ruff 0.9.1 --- typer/main.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/typer/main.py b/typer/main.py index 36737e49ef..8beb61f7a5 100644 --- a/typer/main.py +++ b/typer/main.py @@ -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( @@ -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) ) From d67862ac7e32cb3a2f39f10cf9b6d098856003a9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:43:38 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20for?= =?UTF-8?q?mat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typer/main.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/typer/main.py b/typer/main.py index 8beb61f7a5..36737e49ef 100644 --- a/typer/main.py +++ b/typer/main.py @@ -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( @@ -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) ) From 4b8bc446b74b6b0bae9787c872f3f623f52cc684 Mon Sep 17 00:00:00 2001 From: svlandeg Date: Thu, 16 Jan 2025 10:55:50 +0100 Subject: [PATCH 4/5] ensure precommit version is consistent --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 513db068a5..0fd7d076b1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.9.1 hooks: - id: ruff args: From 1506c80d4af607327561806df20d4cdfe1ce00c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 09:56:04 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20for?= =?UTF-8?q?mat=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typer/main.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/typer/main.py b/typer/main.py index 36737e49ef..8beb61f7a5 100644 --- a/typer/main.py +++ b/typer/main.py @@ -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( @@ -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) )