From 8148867ebfb92e269ca1223211e8c970d4001648 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:27:22 +0000 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=20Bump=20ruff=20from=200.8.6=20to=200?= =?UTF-8?q?.9.1=20(#1118)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ⬆ Bump ruff from 0.8.6 to 0.9.1 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] * format main with ruff 0.9.1 * 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks * ensure precommit version is consistent * 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: svlandeg Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 2 +- requirements-tests.txt | 2 +- typer/main.py | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) 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: 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 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) )