diff --git a/tests/backend/test_jax_executable.py b/tests/backend/test_jax_executable.py index 1499ebd34c..94416659ff 100644 --- a/tests/backend/test_jax_executable.py +++ b/tests/backend/test_jax_executable.py @@ -170,7 +170,7 @@ def test_return_annotation_tuple_type(): ), ): - @executable # pyright: ignore[reportArgumentType, reportGeneralTypeIssues] + @executable # pyright: ignore[reportArgumentType] def abs_wrong_tuple_type(a: jax.Array) -> tuple[int]: ... # pyright: ignore[reportUnusedFunction] @@ -190,7 +190,7 @@ def test_return_annotation_single(): match="Return annotation is must be jnp.ndarray or a tuple of jnp.ndarray", ): - @executable # pyright: ignore[reportArgumentType, reportGeneralTypeIssues] + @executable # pyright: ignore[reportArgumentType] def abs_wrong_single_type(a: jax.Array) -> int: ... # pyright: ignore[reportUnusedFunction] diff --git a/tests/dialects/test_riscv_snitch.py b/tests/dialects/test_riscv_snitch.py index 10225af502..bac78d8de9 100644 --- a/tests/dialects/test_riscv_snitch.py +++ b/tests/dialects/test_riscv_snitch.py @@ -35,7 +35,4 @@ def test_insn_repr(op: RISCVInstruction): # Limitation of Pyright, see https://github.com/microsoft/pyright/issues/7105 # We are currently stuck on an older version of Pyright, the update is # tracked in https://github.com/xdslproject/xdsl/issues/2791 - assert ( - trait.get_insn(op) # pyright: ignore[reportGeneralTypeIssues] - == ground_truth[op.name[13:]] - ) + assert trait.get_insn(op) == ground_truth[op.name[13:]] diff --git a/tests/filecheck/frontend/dialects/affine.py b/tests/filecheck/frontend/dialects/affine.py index 0f9ce3ff80..f2b5541518 100644 --- a/tests/filecheck/frontend/dialects/affine.py +++ b/tests/filecheck/frontend/dialects/affine.py @@ -75,7 +75,7 @@ def test_affine_for_IV(): # CHECK: Expected integer constant for loop end, got 'float'. def test_not_supported_affine_loop_I(): for _ in range( - 12.0 # pyright: ignore[reportArgumentType, reportGeneralTypeIssues] + 12.0 # pyright: ignore[reportArgumentType] ): pass return @@ -90,7 +90,7 @@ def test_not_supported_affine_loop_I(): # CHECK: Expected integer constant for loop start, got 'str'. def test_not_supported_affine_loop_II(): for _ in range( - "boom", # pyright: ignore[reportArgumentType, reportGeneralTypeIssues] + "boom", # pyright: ignore[reportArgumentType] 100, ): pass @@ -108,7 +108,7 @@ def test_not_supported_affine_loop_III(): for _ in range( 0, 100, - 1.0, # pyright: ignore[reportArgumentType, reportGeneralTypeIssues] + 1.0, # pyright: ignore[reportArgumentType] ): pass return diff --git a/tests/irdl/test_declarative_assembly_format.py b/tests/irdl/test_declarative_assembly_format.py index c49f99cac2..4b7b952eea 100644 --- a/tests/irdl/test_declarative_assembly_format.py +++ b/tests/irdl/test_declarative_assembly_format.py @@ -128,7 +128,7 @@ def test_format_and_parse_op(): ): @irdl_op_definition - class FormatAndParseOp(IRDLOperation): # pyright: ignore[reportUnusedClass] + class FormatAndParseOp(IRDLOperation): name = "test.format_and_parse" assembly_format = "attr-dict" diff --git a/tests/test_parser.py b/tests/test_parser.py index 4f80ac78aa..ce96d0941d 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -426,7 +426,7 @@ def test_parse_block_name(): ctx = MLContext() parser = Parser(ctx, block_str) - block = parser._parse_block() # pyright: ignore[reportPrivateUsage] + block = parser._parse_block() assert block.args[0].name_hint == "name" assert block.args[1].name_hint is None diff --git a/tests/test_traits.py b/tests/test_traits.py index 775d3994da..0f38fcfdfa 100644 --- a/tests/test_traits.py +++ b/tests/test_traits.py @@ -205,7 +205,7 @@ def test_traits_undefined(): class WrongTraitsType(IRDLOperation): name = "test.no_traits" - traits = 1 # pyright: ignore[reportGeneralTypeIssues, reportAssignmentType] + traits = 1 # pyright: ignore[reportAssignmentType] def test_traits_wrong_type(): diff --git a/xdsl/dialects/builtin.py b/xdsl/dialects/builtin.py index ab04440f0f..6bce2c8454 100644 --- a/xdsl/dialects/builtin.py +++ b/xdsl/dialects/builtin.py @@ -517,9 +517,8 @@ def print_without_type(self, printer: Printer): def constr( cls, *, - # pyright needs updating, with the new one it works fine value: AttrConstraint | None = None, - type: GenericAttrConstraint[_IntegerAttrType] = IntegerAttrTypeConstr, # pyright: ignore[reportGeneralTypeIssues] + type: GenericAttrConstraint[_IntegerAttrType] = IntegerAttrTypeConstr, ) -> GenericAttrConstraint[IntegerAttr[_IntegerAttrType]]: if value is None and type == AnyAttr(): return BaseAttr[IntegerAttr[_IntegerAttrType]](IntegerAttr) @@ -1604,8 +1603,7 @@ def constr( cls, *, shape: GenericAttrConstraint[Attribute] | None = None, - # pyright needs updating, with the new one it works fine - element_type: GenericAttrConstraint[_MemRefTypeElement] = AnyAttr(), # pyright: ignore[reportGeneralTypeIssues] + element_type: GenericAttrConstraint[_MemRefTypeElement] = AnyAttr(), layout: GenericAttrConstraint[Attribute] | None = None, memory_space: GenericAttrConstraint[Attribute] | None = None, ) -> GenericAttrConstraint[MemRefType[_MemRefTypeElement]]: diff --git a/xdsl/dialects/stream.py b/xdsl/dialects/stream.py index 2a70ca5c37..f61ffc5216 100644 --- a/xdsl/dialects/stream.py +++ b/xdsl/dialects/stream.py @@ -52,8 +52,7 @@ def get_element_type(self) -> _StreamTypeElement: def constr( cls, *, - # pyright needs updating, with the new one it works fine - element_type: GenericAttrConstraint[_StreamTypeElement] = AnyAttr(), # pyright: ignore[reportGeneralTypeIssues] + element_type: GenericAttrConstraint[_StreamTypeElement] = AnyAttr(), ) -> GenericAttrConstraint[StreamType[_StreamTypeElement]]: if element_type == AnyAttr(): return BaseAttr[StreamType[_StreamTypeElement]](StreamType) diff --git a/xdsl/frontend/dialects/builtin.py b/xdsl/frontend/dialects/builtin.py index 4bae22a9aa..0a2ae3db48 100644 --- a/xdsl/frontend/dialects/builtin.py +++ b/xdsl/frontend/dialects/builtin.py @@ -39,8 +39,8 @@ def __add__( from xdsl.frontend.dialects.arith import addi return addi( - self, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] + self, # pyright: ignore[reportUnknownVariableType, reportArgumentType] + other, # pyright: ignore[reportArgumentType] ) def __and__( @@ -49,8 +49,8 @@ def __and__( from xdsl.frontend.dialects.arith import andi return andi( - self, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] + self, # pyright: ignore[reportUnknownVariableType, reportArgumentType] + other, # pyright: ignore[reportArgumentType] ) def __lshift__( @@ -59,8 +59,8 @@ def __lshift__( from xdsl.frontend.dialects.arith import shli return shli( - self, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] + self, # pyright: ignore[reportUnknownVariableType, reportArgumentType] + other, # pyright: ignore[reportArgumentType] ) def __mul__( @@ -69,8 +69,8 @@ def __mul__( from xdsl.frontend.dialects.arith import muli return muli( - self, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] + self, # pyright: ignore[reportUnknownVariableType, reportArgumentType] + other, # pyright: ignore[reportArgumentType] ) def __rshift__( @@ -79,8 +79,8 @@ def __rshift__( from xdsl.frontend.dialects.arith import shrsi return shrsi( - self, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] + self, # pyright: ignore[reportUnknownVariableType, reportArgumentType] + other, # pyright: ignore[reportArgumentType] ) def __sub__( @@ -89,8 +89,8 @@ def __sub__( from xdsl.frontend.dialects.arith import subi return subi( - self, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportUnknownVariableType, reportArgumentType] + self, # pyright: ignore[reportUnknownVariableType, reportArgumentType] + other, # pyright: ignore[reportArgumentType] ) def __eq__( # pyright: ignore[reportIncompatibleMethodOverride] @@ -99,8 +99,8 @@ def __eq__( # pyright: ignore[reportIncompatibleMethodOverride] from xdsl.frontend.dialects.arith import cmpi return cmpi( - self, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] + self, # pyright: ignore[reportArgumentType] + other, # pyright: ignore[reportArgumentType] "eq", ) @@ -108,8 +108,8 @@ def __ge__(self, other: _Integer[_Width, _Signedness]) -> i1: from xdsl.frontend.dialects.arith import cmpi return cmpi( - self, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] + self, # pyright: ignore[reportArgumentType] + other, # pyright: ignore[reportArgumentType] "sge", ) @@ -117,8 +117,8 @@ def __gt__(self, other: _Integer[_Width, _Signedness]) -> i1: from xdsl.frontend.dialects.arith import cmpi return cmpi( - self, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] + self, # pyright: ignore[reportArgumentType] + other, # pyright: ignore[reportArgumentType] "sgt", ) @@ -126,8 +126,8 @@ def __le__(self, other: _Integer[_Width, _Signedness]) -> i1: from xdsl.frontend.dialects.arith import cmpi return cmpi( - self, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] + self, # pyright: ignore[reportArgumentType] + other, # pyright: ignore[reportArgumentType] "sle", ) @@ -135,8 +135,8 @@ def __lt__(self, other: _Integer[_Width, _Signedness]) -> i1: from xdsl.frontend.dialects.arith import cmpi return cmpi( - self, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] + self, # pyright: ignore[reportArgumentType] + other, # pyright: ignore[reportArgumentType] "slt", ) @@ -146,8 +146,8 @@ def __ne__( # pyright: ignore[reportIncompatibleMethodOverride] from xdsl.frontend.dialects.arith import cmpi return cmpi( - self, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] - other, # pyright: ignore[reportGeneralTypeIssues, reportArgumentType] + self, # pyright: ignore[reportArgumentType] + other, # pyright: ignore[reportArgumentType] "ne", ) diff --git a/xdsl/frontend/type_conversion.py b/xdsl/frontend/type_conversion.py index f212474a9e..2c24a4af3f 100644 --- a/xdsl/frontend/type_conversion.py +++ b/xdsl/frontend/type_conversion.py @@ -3,7 +3,7 @@ from typing import ( Any, TypeAlias, - _GenericAlias, # pyright: ignore[reportPrivateUsage, reportGeneralTypeIssues, reportUnknownVariableType, reportAttributeAccessIssue] + _GenericAlias, # pyright: ignore[reportUnknownVariableType, reportAttributeAccessIssue] ) import xdsl.dialects.builtin as xdsl_builtin diff --git a/xdsl/irdl/attributes.py b/xdsl/irdl/attributes.py index 9da43704d0..7a9969e751 100644 --- a/xdsl/irdl/attributes.py +++ b/xdsl/irdl/attributes.py @@ -240,9 +240,9 @@ def irdl_param_attr_definition(cls: _PAttrTT) -> _PAttrTT: return runtime_final( dataclass(frozen=True, init=False)( type.__new__( - type(cls), # pyright: ignore[reportUnknownArgumentType] + type(cls), cls.__name__, - (cls,), # pyright: ignore[reportUnknownArgumentType] + (cls,), {**cls.__dict__, **new_fields}, ) ) diff --git a/xdsl/tools/tblgen_to_py.py b/xdsl/tools/tblgen_to_py.py index 27bc8ab426..c3f9fb7db5 100644 --- a/xdsl/tools/tblgen_to_py.py +++ b/xdsl/tools/tblgen_to_py.py @@ -455,7 +455,7 @@ def generate_op(self, tblgen_op: TblgenOp, dialect_name: str): "SizedRegion" in region.superclasses and region.summary == "region with 1 blocks" ) - match (variadic, single_block): # pyright: ignore[reportMatchNotExhaustive] + match (variadic, single_block): case (False, False): fields[name] = "region_def()" case (False, True): diff --git a/xdsl/transforms/varith_transformations.py b/xdsl/transforms/varith_transformations.py index 9dc71f6ae7..7e03cb0410 100644 --- a/xdsl/transforms/varith_transformations.py +++ b/xdsl/transforms/varith_transformations.py @@ -131,7 +131,7 @@ def match_and_rewrite(self, op: varith.VarithOp, rewriter: PatternRewriter, /): # instantiate a new varith op of the same type as the old op: # we can ignore the type error as we know that all VarithOps are instantiated # with an *arg of their operands - rewriter.replace_matched_op(type(op)(*new_operands)) # pyright: ignore[reportUnknownArgumentType] + rewriter.replace_matched_op(type(op)(*new_operands)) # check all ops that may be erased later: for old_op in possibly_erased_ops: