Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies = [
"markdown",
"mypy",
"pycroscope",
"pyrefly==1.3.0.dev1",
"pyrefly",
"pyright",
"tomlkit",
"ty",
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/mypy/callables_kwargs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ output = """
callables_kwargs.py:46: error: Missing named argument "v1" for "func1" [call-arg]
callables_kwargs.py:46: error: Missing named argument "v3" for "func1" [call-arg]
callables_kwargs.py:51: error: Unexpected keyword argument "v4" for "func1" [call-arg]
callables_kwargs.py:52: error: Too many positional arguments for "func1" [misc]
callables_kwargs.py:52: error: Too many positional arguments for "func1" [call-arg]
callables_kwargs.py:58: error: Argument 1 to "func1" has incompatible type "**dict[str, str]"; expected "int" [arg-type]
callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, object]"; expected "int" [arg-type]
callables_kwargs.py:61: error: Argument 1 to "func1" has incompatible type "**dict[str, object]"; expected "str" [arg-type]
Expand Down
4 changes: 1 addition & 3 deletions conformance/results/mypy/constructors_callable.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ errors_diff = """
Line 129: Expected 1 errors
Line 146: Expected 1 errors
Line 74: Unexpected errors ['constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]']
Line 80: Unexpected errors ['constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type]']
Line 102: Unexpected errors ['constructors_callable.py:102: error: Expression is of type "Class5", not "Never" [assert-type]']
Line 107: Unexpected errors ['constructors_callable.py:107: error: Expression is of type "Class5", not "Never" [assert-type]']
Line 118: Unexpected errors ['constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]']
Expand All @@ -27,8 +26,7 @@ constructors_callable.py:66: error: Too few arguments [call-arg]
constructors_callable.py:67: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:68: error: Too many arguments [call-arg]
constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]
constructors_callable.py:79: note: Revealed type is "def (x: int) -> constructors_callable.Class4"
constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type]
constructors_callable.py:79: note: Revealed type is "def (x: int) -> int"
constructors_callable.py:81: error: Too few arguments [call-arg]
constructors_callable.py:82: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:99: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5"
Expand Down
6 changes: 3 additions & 3 deletions conformance/results/mypy/dataclasses_kwonly.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
conformant = "Pass"
output = """
dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" [misc]
dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" [misc]
dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" [misc]
dataclasses_kwonly.py:23: error: Too many positional arguments for "DC1" [call-arg]
dataclasses_kwonly.py:38: error: Too many positional arguments for "DC2" [call-arg]
dataclasses_kwonly.py:53: error: Too many positional arguments for "DC3" [call-arg]
"""
conformance_automated = "Pass"
errors_diff = """
Expand Down
4 changes: 2 additions & 2 deletions conformance/results/mypy/dataclasses_transform_class.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ conformant = "Pass"
output = """
dataclasses_transform_class.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc]
dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only [misc]
dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [misc]
dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [call-arg]
dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") [operator]
dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" [misc]
dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" [call-arg]
dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only [misc]
"""
conformance_automated = "Pass"
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/mypy/dataclasses_transform_field.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Does not properly handle field constructor that has default value for `kw_only`
"""
output = """
dataclasses_transform_field.py:64: error: Unexpected keyword argument "id" for "CustomerModel1" [call-arg]
dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" [misc]
dataclasses_transform_field.py:75: error: Too many positional arguments for "CustomerModel2" [call-arg]
dataclasses_transform_field.py:75: error: Missing named argument "name" for "CustomerModel2" [call-arg]
dataclasses_transform_field.py:77: error: Missing named argument "id" for "CustomerModel2" [call-arg]
"""
Expand Down
6 changes: 3 additions & 3 deletions conformance/results/mypy/dataclasses_transform_func.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Does not handle `kw_only=False` override when `kw_only_default=True`.
Does not report error when `order=False` and comparison operators are used.
"""
output = """
dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [misc]
dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [call-arg]
dataclasses_transform_func.py:56: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment]
dataclasses_transform_func.py:64: error: Unexpected keyword argument "salary" for "Customer1" [call-arg]
dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" [misc]
dataclasses_transform_func.py:70: error: Too many positional arguments for "Customer2" [call-arg]
dataclasses_transform_func.py:89: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc]
dataclasses_transform_func.py:96: error: Property "id" defined in "Customer3" is read-only [misc]
"""
conformance_automated = "Fail"
errors_diff = """
Line 60: Expected 1 errors
Line 52: Unexpected errors ['dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [misc]']
Line 52: Unexpected errors ['dataclasses_transform_func.py:52: error: Too many positional arguments for "Customer1" [call-arg]']
"""
4 changes: 2 additions & 2 deletions conformance/results/mypy/dataclasses_transform_meta.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ conformant = "Pass"
output = """
dataclasses_transform_meta.py:51: error: Non-frozen dataclass cannot inherit from a frozen dataclass [misc]
dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only [misc]
dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [misc]
dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [call-arg]
dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") [operator]
dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" [misc]
dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" [call-arg]
dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only [misc]
"""
conformance_automated = "Pass"
Expand Down
4 changes: 2 additions & 2 deletions conformance/results/mypy/directives_type_ignore.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ notes = """
Does not honor `# type: ignore` comment if comment includes additional text.
"""
output = """
directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax]
directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax]
directives_type_ignore.py:16: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
directives_type_ignore.py:16: note: Error code "assignment" not covered by "type: ignore[an-empty-str-is-not-an-int]" comment
"""
conformance_automated = "Fail"
errors_diff = """
Line 11: Unexpected errors ['directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax]', 'directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]']
Line 11: Unexpected errors ['directives_type_ignore.py:11: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]', 'directives_type_ignore.py:11: error: Invalid "type: ignore" comment [syntax]']
"""
4 changes: 1 addition & 3 deletions conformance/results/mypy/generics_defaults.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ Does not fully support defaults on `TypeVarTuple` and `ParamSpec`.
output = """
generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc]
generics_defaults.py:66: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given [type-arg]
generics_defaults.py:139: error: Expression is of type "tuple[*tuple[str, int], ...]", not "tuple[str, int]" [assert-type]
generics_defaults.py:152: error: TypeVar default must be a subtype of the bound type [misc]
generics_defaults.py:159: error: TypeVar default must be one of the constraint types [misc]
generics_defaults.py:177: error: Expression is of type "int", not "Any" [assert-type]
generics_defaults.py:188: error: A type variable with default cannot follow TypeVarTuple [type-var]
generics_defaults.py:203: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [valid-type]
generics_defaults.py:204: error: Expression is of type "tuple[Any, ...]", not "tuple[int, str]" [assert-type]
generics_defaults.py:205: error: Expression is of type "def (*Any, **Any) -> None", not "Callable[[float, bool], None]" [assert-type]
"""
conformance_automated = "Fail"
errors_diff = """
Line 188: Expected 1 errors
Line 139: Unexpected errors ['generics_defaults.py:139: error: Expression is of type "tuple[*tuple[str, int], ...]", not "tuple[str, int]" [assert-type]']
Line 203: Unexpected errors ['generics_defaults.py:203: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [valid-type]']
Line 204: Unexpected errors ['generics_defaults.py:204: error: Expression is of type "tuple[Any, ...]", not "tuple[int, str]" [assert-type]']
Line 205: Unexpected errors ['generics_defaults.py:205: error: Expression is of type "def (*Any, **Any) -> None", not "Callable[[float, bool], None]" [assert-type]']
Expand Down
6 changes: 2 additions & 4 deletions conformance/results/mypy/generics_defaults_referential.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ notes = """
Does not correctly handle defaults referencing other `TypeVar`s.
"""
output = """
generics_defaults_referential.py:36: error: Argument 2 to "Foo" has incompatible type "str"; expected "int" [arg-type]
generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]
generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc]
generics_defaults_referential.py:60: error: Type variable S1 referenced in the default of S2 is unbound [misc]
generics_defaults_referential.py:60: error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope [misc]
generics_defaults_referential.py:74: error: TypeVar default must be one of the constraint types [misc]
generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]
generics_defaults_referential.py:78: error: TypeVar default must be one of the constraint types [misc]
generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]
"""
conformance_automated = "Fail"
errors_diff = """
Line 36: Expected 1 errors
Line 68: Expected 1 errors
Line 77: Unexpected errors ['generics_defaults_referential.py:77: error: TypeVar default must be one of the constraint types [misc]']
Line 103: Unexpected errors ['generics_defaults_referential.py:103: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]']
"""
9 changes: 6 additions & 3 deletions conformance/results/mypy/generics_syntax_declarations.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
conformant = "Pass"
conformant = "Partial"
notes = """
Doesn't flag TypeVar with empty constraints.
"""
output = """
generics_syntax_declarations.py:17: error: Generic[...] base class is redundant [misc]
generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class [misc]
generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" [attr-defined]
generics_syntax_declarations.py:44: error: Name "V" is not defined [name-defined]
generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type [valid-type]
generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types [misc]
generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types [misc]
generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type [valid-type]
generics_syntax_declarations.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? [valid-type]
generics_syntax_declarations.py:79: error: Name "S" is not defined [name-defined]
"""
conformance_automated = "Pass"
conformance_automated = "Fail"
errors_diff = """
Line 60: Expected 1 errors
"""
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Incorrectly specializes generic alias that includes a `TypeVar` and `TypeVarTupl
Rejects specialization of generic type alias defined as a tuple containing a `TypeVar`.
"""
output = """
generics_typevartuple_specialization.py:85: error: Argument 1 to "takes_float_array_with_specific_shape" has incompatible type "Array2[float, *tuple[Any, ...]]"; expected "Array2[float, Height, Width]" [arg-type]
generics_typevartuple_specialization.py:108: error: Type application is only supported for generic classes [misc]
generics_typevartuple_specialization.py:109: error: Type application is only supported for generic classes [misc]
generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position [valid-type]
Expand All @@ -17,6 +16,5 @@ generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split
"""
conformance_automated = "Fail"
errors_diff = """
Line 85: Unexpected errors ['generics_typevartuple_specialization.py:85: error: Argument 1 to "takes_float_array_with_specific_shape" has incompatible type "Array2[float, *tuple[Any, ...]]"; expected "Array2[float, Height, Width]" [arg-type]']
Line 108: Unexpected errors ['generics_typevartuple_specialization.py:108: error: Type application is only supported for generic classes [misc]']
"""
2 changes: 0 additions & 2 deletions conformance/results/mypy/historical_positional.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ Applies legacy positional-only rules when PEP 570 syntax is used.
"""
output = """
historical_positional.py:18: error: Unexpected keyword argument "__x" for "f1" [call-arg]
historical_positional.py:48: error: Unexpected keyword argument "__y" for "f3" [call-arg]
historical_positional.py:59: error: Unexpected keyword argument "__x" for "m1" of "A" [call-arg]
historical_positional.py:69: error: Unexpected keyword argument "__y" for "f4" [call-arg]
"""
conformance_automated = "Fail"
errors_diff = """
Line 26: Expected 1 errors
Line 54: Expected 1 errors
Line 48: Unexpected errors ['historical_positional.py:48: error: Unexpected keyword argument "__y" for "f3" [call-arg]']
Line 69: Unexpected errors ['historical_positional.py:69: error: Unexpected keyword argument "__y" for "f4" [call-arg]']
"""
2 changes: 1 addition & 1 deletion conformance/results/mypy/literals_parameterizations.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ literals_parameterizations.py:47: error: Parameter 1 of Literal[...] is invalid
literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid [valid-type]
literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid [valid-type]
literals_parameterizations.py:50: error: Parameter 1 of Literal[...] is invalid [valid-type]
literals_parameterizations.py:51: error: Parameter 1 of Literal[...] cannot be of type "float" [valid-type]
literals_parameterizations.py:51: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type]
literals_parameterizations.py:52: error: Parameter 1 of Literal[...] cannot be of type "Any" [valid-type]
literals_parameterizations.py:53: error: Parameter 1 of Literal[...] is invalid [valid-type]
literals_parameterizations.py:56: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type]
Expand Down
27 changes: 4 additions & 23 deletions conformance/results/mypy/specialtypes_sentinels.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,8 @@
conformant = "Unsupported"
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 36: Expected 1 errors
Line 39: Expected 1 errors
Line 20: Unexpected errors ['specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type]', 'specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type]']
Line 22: Unexpected errors ['specialtypes_sentinels.py:22: error: Expression is of type "Any", not MISSING? [assert-type]', 'specialtypes_sentinels.py:22: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type]']
Line 24: Unexpected errors ['specialtypes_sentinels.py:24: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type]']
Line 26: Unexpected errors ['specialtypes_sentinels.py:26: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type]']
Line 28: Unexpected errors ['specialtypes_sentinels.py:28: error: Expression is of type "Any", not Cls.IN_CLASS? [assert-type]', 'specialtypes_sentinels.py:28: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type]']
"""
output = """
specialtypes_sentinels.py:14: error: Incompatible default for parameter "x" (default has type "Sentinel", parameter has type "int") [assignment]
specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type]
specialtypes_sentinels.py:20: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
specialtypes_sentinels.py:20: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type]
specialtypes_sentinels.py:22: error: Expression is of type "Any", not MISSING? [assert-type]
specialtypes_sentinels.py:22: error: Variable "specialtypes_sentinels.MISSING" is not valid as a type [valid-type]
specialtypes_sentinels.py:22: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
specialtypes_sentinels.py:24: error: Variable "specialtypes_sentinels.SPECIAL" is not valid as a type [valid-type]
specialtypes_sentinels.py:24: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
specialtypes_sentinels.py:26: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type]
specialtypes_sentinels.py:26: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
specialtypes_sentinels.py:28: error: Expression is of type "Any", not Cls.IN_CLASS? [assert-type]
specialtypes_sentinels.py:28: error: Variable "specialtypes_sentinels.Cls.IN_CLASS" is not valid as a type [valid-type]
specialtypes_sentinels.py:28: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
specialtypes_sentinels.py:14: error: Incompatible default for parameter "x" (default has type "MISSING", parameter has type "int") [assignment]
specialtypes_sentinels.py:36: error: Argument 1 to "func2" has incompatible type "Cls.IN_CLASS"; expected "int | MISSING | SPECIAL" [arg-type]
specialtypes_sentinels.py:39: error: Argument 1 to "func3" has incompatible type "MISSING"; expected "int | Cls.IN_CLASS" [arg-type]
"""
Loading
Loading