From a62d428480e7a4063cb26b20afc2c6eadaa22be1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 20 Jul 2024 09:36:09 +0000 Subject: [PATCH 1/2] Update pre-commit hook pre-commit/mirrors-mypy to v1.11.0 --- .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 b2036a8..77f5f7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: - id: flake8 # Static Type checking: MyPy - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.10.1 + rev: v1.11.0 hooks: - id: mypy additional_dependencies: From ee85c657a33d89a95c69115913812e063bd86a95 Mon Sep 17 00:00:00 2001 From: esc Date: Mon, 22 Jul 2024 14:53:21 +0200 Subject: [PATCH 2/2] ignore existing mypy errors As title --- numba_rvsdg/core/datastructures/ast_transforms.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/numba_rvsdg/core/datastructures/ast_transforms.py b/numba_rvsdg/core/datastructures/ast_transforms.py index 86f4628..665577c 100644 --- a/numba_rvsdg/core/datastructures/ast_transforms.py +++ b/numba_rvsdg/core/datastructures/ast_transforms.py @@ -686,8 +686,8 @@ def transform( lineno=0, decorator_list=original.decorator_list, returns=original.returns, - ) - return fdef + ) # type: ignore + return fdef # type: ignore def lookup(self, item: Any) -> Any: subregion_scfg = self.region_stack[-1].subregion @@ -714,7 +714,7 @@ def codegen(self, block: Any) -> list[ast.AST]: test = block.tree[-1].value # type: ignore body = self.codegen(self.lookup(block.jump_targets[0])) orelse = self.codegen(self.lookup(block.jump_targets[1])) - if_node = ast.If(test, body, orelse) + if_node = ast.If(test, body, orelse) # type: ignore return block.tree[:-1] + [if_node] elif block.fallthrough and type(block.tree[-1]) is ast.Return: # The value of the ast.Return could be either None or an @@ -850,8 +850,10 @@ def if_cascade(jump_targets: list[str]) -> list[ast.AST]: # recurse for the rest of the jump_targets. if_node = ast.If( test=if_test, - body=self.codegen(self.lookup(current)), - orelse=if_cascade(jump_targets), + body=self.codegen( + self.lookup(current) + ), # type: ignore + orelse=if_cascade(jump_targets), # type: ignore ) return [if_node]