diff --git a/conformance/README.md b/conformance/README.md index cccf1dea..0b60a949 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -81,7 +81,7 @@ Note that some type checkers may not run on some platforms. If a type checker fa Different type checkers report errors in different ways (with different wording in error messages and different line numbers or character ranges for errors). This variation makes it difficult to fully automate test validation given that tests will want to check for both false positive and false negative type errors. Some level of manual inspection will therefore be needed to determine whether a type checker is fully conformant with all tests in any given test file. This "scoring" process is required only when the output of a test changes — e.g. when a new version of that type checker is released and the tests are rerun. We assume that the output of a type checker will be the same from one run to the next unless/until a new version is released that fixes or introduces a bug. In this case, the output will need to be manually inspected and the conformance results re-scored for those tests whose output has changed. -[Conformance results](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html) are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, zuban and ty. It is the goal and desire to add additional type checkers over time. +[Conformance results](https://htmlpreview.github.io/?https://github.com/python/typing/blob/main/conformance/results/results.html) are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, zuban, ty, and pycroscope. It is the goal and desire to add additional type checkers over time. ## Adding a New Test Case diff --git a/conformance/pyproject.toml b/conformance/pyproject.toml index 7483444b..e44dadf6 100644 --- a/conformance/pyproject.toml +++ b/conformance/pyproject.toml @@ -4,6 +4,7 @@ version = "0.1.0" requires-python = "==3.12.*" dependencies = [ "mypy", + "pycroscope", "pyrefly", "pyright", "tomli", diff --git a/conformance/results/pycroscope/aliases_explicit.toml b/conformance/results/pycroscope/aliases_explicit.toml new file mode 100644 index 00000000..61a47bec --- /dev/null +++ b/conformance/results/pycroscope/aliases_explicit.toml @@ -0,0 +1,26 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./aliases_explicit.py:67:8: Expected 0 type arguments for type alias, got 1 [invalid_specialization] +./aliases_explicit.py:68:8: Expected 0 type arguments for type alias, got 1 [invalid_specialization] +./aliases_explicit.py:69:8: Expected 1 type arguments for type alias, got 2 [invalid_specialization] +./aliases_explicit.py:70:8: Expected 1 type arguments for type alias, got 2 [invalid_specialization] +./aliases_explicit.py:71:8: ParamSpec specialization must use list form, Concatenate[..., P], P, or ... [invalid_annotation] +./aliases_explicit.py:79:20: Invalid type annotation [invalid_annotation] +./aliases_explicit.py:80:20: Unrecognized annotation [invalid_annotation] +./aliases_explicit.py:81:20: Unrecognized annotation tuple[tuple[type 'int', type 'str']] [invalid_annotation] +./aliases_explicit.py:82:20: Invalid type annotation [invalid_annotation] +./aliases_explicit.py:83:20: Unrecognized annotation [invalid_annotation] +./aliases_explicit.py:84:20: Invalid type annotation [invalid_annotation] +./aliases_explicit.py:85:20: Cannot resolve subscripted annotation: [invalid_annotation] +./aliases_explicit.py:86:20: Invalid type annotation [invalid_annotation] +./aliases_explicit.py:87:20: Invalid type annotation 3 [invalid_annotation] +./aliases_explicit.py:88:21: Invalid type annotation True [invalid_annotation] +./aliases_explicit.py:89:21: Invalid type annotation 1 [invalid_annotation] +./aliases_explicit.py:90:21: Invalid type annotation [invalid_annotation] +./aliases_explicit.py:91:21: Invalid type annotation [invalid_annotation] +./aliases_explicit.py:100:4: Expected 0 type arguments for type alias, got 1 [invalid_specialization] +./aliases_explicit.py:101:5: TypeForm[.ListOrSetAlias] (synthetic from Literal[list | set]) is not callable [not_callable] +./aliases_explicit.py:102:4: Expected 0 type arguments for type alias, got 1 [invalid_specialization] +""" diff --git a/conformance/results/pycroscope/aliases_implicit.toml b/conformance/results/pycroscope/aliases_implicit.toml new file mode 100644 index 00000000..51e2e303 --- /dev/null +++ b/conformance/results/pycroscope/aliases_implicit.toml @@ -0,0 +1,42 @@ +conformant = "Partial" +notes = """ +Fails to handle various weird annotations. +Various bugs with resolving generic aliases. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 76: Expected 1 errors +Line 106: Expected 1 errors +Line 111: Expected 1 errors +Line 112: Expected 1 errors +Line 113: Expected 1 errors +Line 117: Expected 1 errors +Line 118: Expected 1 errors +Line 119: Expected 1 errors +Line 68: Unexpected errors ['./aliases_implicit.py:68:16: .GoodTypeAlias9[, None] = (int, /, ****P) -> ~R is not equivalent to (int, str, str, /) -> None'] +Line 70: Unexpected errors ['./aliases_implicit.py:70:16: Any[from_another] is not equivalent to int | str | list[list[int]] | None'] +Line 72: Unexpected errors ['./aliases_implicit.py:72:16: .GoodTypeAlias13 = (**__P: **P) -> None is not equivalent to (...) -> None'] +Line 95: Unexpected errors ["./aliases_implicit.py:95:16: Cannot resolve subscripted annotation: [invalid_annotation]"] +Line 100: Unexpected errors ["./aliases_implicit.py:100:17: Annotated[type 'list', (<+list is_truthy None> == NullConstraint())] is always True because it does not provide __bool__ [type_always_true]"] +""" +output = """ +./aliases_implicit.py:68:16: .GoodTypeAlias9[, None] = (int, /, ****P) -> ~R is not equivalent to (int, str, str, /) -> None +./aliases_implicit.py:70:16: Any[from_another] is not equivalent to int | str | list[list[int]] | None +./aliases_implicit.py:72:16: .GoodTypeAlias13 = (**__P: **P) -> None is not equivalent to (...) -> None +./aliases_implicit.py:77:8: Unrecognized annotation types.GenericAlias [invalid_annotation] +./aliases_implicit.py:78:8: Expected 1 type arguments for type alias, got 2 [invalid_specialization] +./aliases_implicit.py:79:8: Expected 1 type arguments for type alias, got 2 [invalid_specialization] +./aliases_implicit.py:80:8: ParamSpec specialization must use list form, Concatenate[..., P], P, or ... [invalid_annotation] +./aliases_implicit.py:81:8: Type argument str is not compatible with ~TFloat@./aliases_implicit.py.GoodTypeAlias12 [invalid_specialization] +./aliases_implicit.py:95:16: Cannot resolve subscripted annotation: [invalid_annotation] +./aliases_implicit.py:100:17: Annotated[type 'list', (<+list is_truthy None> == NullConstraint())] is always True because it does not provide __bool__ [type_always_true] +./aliases_implicit.py:107:8: Invalid type annotation [, ] [invalid_annotation] +./aliases_implicit.py:108:8: Invalid type annotation ((, ),) [invalid_annotation] +./aliases_implicit.py:109:8: Unrecognized annotation [invalid_annotation] +./aliases_implicit.py:110:8: Invalid type annotation {'a': 'b'} [invalid_annotation] +./aliases_implicit.py:114:8: Invalid type annotation 3 [invalid_annotation] +./aliases_implicit.py:115:9: Invalid type annotation True [invalid_annotation] +./aliases_implicit.py:116:9: Invalid type annotation 1 [invalid_annotation] +./aliases_implicit.py:133:5: Literal[list | set] is not callable [not_callable] +./aliases_implicit.py:135:4: Unrecognized annotation object [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/aliases_newtype.toml b/conformance/results/pycroscope/aliases_newtype.toml new file mode 100644 index 00000000..c0ce676a --- /dev/null +++ b/conformance/results/pycroscope/aliases_newtype.toml @@ -0,0 +1,19 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./aliases_newtype.py:11:7: Incompatible argument type for x: expected int but got Literal['user'] [incompatible_argument] +./aliases_newtype.py:12:0: Incompatible assignment: expected NewType('UserId', int), got Literal[42] [incompatible_assignment] +./aliases_newtype.py:18:0: Incompatible assignment: expected type, got Literal[pycroscope.implementation.UserId] [incompatible_assignment] +./aliases_newtype.py:23:15: Second argument to "isinstance" must be a type, union, or tuple of types, not "pycroscope.implementation.UserId" [incompatible_argument] +./aliases_newtype.py:26:20: NewType cannot be used as a base class [invalid_base] +./aliases_newtype.py:35:19: NewType named 'BadName' must be assigned to a variable with the same name [must_have_same_name] +./aliases_newtype.py:41:5: Object Literal[pycroscope.implementation.GoodNewType1] does not support subscripting [unsupported_operation] +./aliases_newtype.py:47:37: NewType base type cannot be generic [incompatible_call] +./aliases_newtype.py:50:37: NewType base type cannot be generic [incompatible_call] +./aliases_newtype.py:52:37: NewType base type cannot be a protocol [incompatible_call] +./aliases_newtype.py:54:37: NewType base type cannot be a literal type [incompatible_call] +./aliases_newtype.py:61:37: NewType base type cannot be a TypedDict [incompatible_call] +./aliases_newtype.py:63:14: In call to typing.NewType: Takes 2 positional arguments but 3 were given [incompatible_call] +./aliases_newtype.py:65:37: NewType base type cannot be Any [incompatible_call] +""" diff --git a/conformance/results/pycroscope/aliases_recursive.toml b/conformance/results/pycroscope/aliases_recursive.toml new file mode 100644 index 00000000..471c9bea --- /dev/null +++ b/conformance/results/pycroscope/aliases_recursive.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./aliases_recursive.py:19:0: Incompatible assignment: expected int | str | float | list[int | str | float | list[.Json = int | str | float | list[int | str | float | list[.Json] | dict[str, .Json] | None] | dict[str, int | str | float | list[.Json] | dict[str, .Json] | None] | None] | dict[str, .Json = int | str | float | list[int | str | float | list[.Json] | dict[str, .Json] | None] | dict[str, int | str | float | list[.Json] | dict[str, .Json] | None] | None] | None] | dict[str, int | str | float | list[.Json = int | str | float | list[int | str | float | list[.Json] | dict[str, .Json] | None] | dict[str, int | str | float | list[.Json] | dict[str, .Json] | None] | None] | dict[str, .Json = int | str | float | list[int | str | float | list[.Json] | dict[str, .Json] | None] | dict[str, int | str | float | list[.Json] | dict[str, .Json] | None] | None] | None] | None, got Literal[{'a': 1, 'b': 3j}] [incompatible_assignment] +./aliases_recursive.py:20:0: Incompatible assignment: expected int | str | float | list[int | str | float | list[.Json = int | str | float | list[int | str | float | list[.Json] | dict[str, .Json] | None] | dict[str, int | str | float | list[.Json] | dict[str, .Json] | None] | None] | dict[str, .Json = int | str | float | list[int | str | float | list[.Json] | dict[str, .Json] | None] | dict[str, int | str | float | list[.Json] | dict[str, .Json] | None] | None] | None] | dict[str, int | str | float | list[.Json = int | str | float | list[int | str | float | list[.Json] | dict[str, .Json] | None] | dict[str, int | str | float | list[.Json] | dict[str, .Json] | None] | None] | dict[str, .Json = int | str | float | list[int | str | float | list[.Json] | dict[str, .Json] | None] | dict[str, int | str | float | list[.Json] | dict[str, .Json] | None] | None] | None] | None, got Literal[[2, 3j]] [incompatible_assignment] +./aliases_recursive.py:38:0: Incompatible assignment: expected str | int | tuple[str | int | tuple[.RecursiveTuple = str | int | tuple[str | int | tuple[.RecursiveTuple, ...], ...], ...], ...], got Literal[(1, ('1', 1), (1, (1, [2])))] [incompatible_assignment] +./aliases_recursive.py:39:0: Incompatible assignment: expected str | int | tuple[str | int | tuple[.RecursiveTuple = str | int | tuple[str | int | tuple[.RecursiveTuple, ...], ...], ...], ...], got Literal[(1, [1])] [incompatible_assignment] +./aliases_recursive.py:50:0: Incompatible assignment: expected str | int | collections.abc.Mapping[str, str | int | collections.abc.Mapping[str, None.RecursiveMapping = str | int | collections.abc.Mapping[str, str | int | collections.abc.Mapping[str, None.RecursiveMapping]]]], got Literal[{'1': [1]}] [incompatible_assignment] +./aliases_recursive.py:51:0: Incompatible assignment: expected str | int | collections.abc.Mapping[str, str | int | collections.abc.Mapping[str, None.RecursiveMapping = str | int | collections.abc.Mapping[str, str | int | collections.abc.Mapping[str, None.RecursiveMapping]]]], got Literal[{'1': '1', '2': 1, '3': [1, 2]}] [incompatible_assignment] +./aliases_recursive.py:52:0: Incompatible assignment: expected str | int | collections.abc.Mapping[str, str | int | collections.abc.Mapping[str, None.RecursiveMapping = str | int | collections.abc.Mapping[str, str | int | collections.abc.Mapping[str, None.RecursiveMapping]]]], got Literal[{'1': '1', '2': 1, '3': {'0': '0', '1': 1, '2': [1, 2, 3]}}] [incompatible_assignment] +./aliases_recursive.py:63:0: Incompatible assignment: expected aliases_recursive.GenericTypeAlias1[str] = list[aliases_recursive.GenericTypeAlias1[~T1] = list[aliases_recursive.GenericTypeAlias1[~T1] | ~T1] | ~T1], got Literal[['hi', [2.4]]] [incompatible_assignment] +./aliases_recursive.py:69:0: Incompatible assignment: expected aliases_recursive.GenericTypeAlias2[str, int] = list[aliases_recursive.GenericTypeAlias2[~T1, ~T2] = list[aliases_recursive.GenericTypeAlias2[~T1, ~T2] | ~T1 | ~T2] | ~T1 | ~T2], got Literal[[[3, ['hi', 3, [3.4]]], 'hi']] [incompatible_assignment] +./aliases_recursive.py:72:0: Type alias RecursiveUnion has a circular definition [invalid_type_alias] +./aliases_recursive.py:75:0: Type alias MutualReference1 has a circular definition [invalid_type_alias] +./aliases_recursive.py:75:62: Type alias MutualReference2 has a circular definition [invalid_type_alias] +""" diff --git a/conformance/results/pycroscope/aliases_type_statement.toml b/conformance/results/pycroscope/aliases_type_statement.toml new file mode 100644 index 00000000..9961849b --- /dev/null +++ b/conformance/results/pycroscope/aliases_type_statement.toml @@ -0,0 +1,35 @@ +conformant = "Partial" +notes = """ +Fails to reject various weird annotations. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 37: Expected 1 errors +Line 38: Expected 1 errors +Line 39: Expected 1 errors +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 44: Expected 1 errors +Line 45: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 49: Expected 1 errors +""" +output = """ +./aliases_type_statement.py:17:0: typing.TypeAliasType has no attribute 'bit_count' [undefined_attribute] +./aliases_type_statement.py:19:0: TypeForm[.GoodAlias1] (synthetic from typing.TypeAliasType) is not callable [not_callable] +./aliases_type_statement.py:23:6: typing.TypeAliasType has no attribute 'other_attrib' [undefined_attribute] +./aliases_type_statement.py:26:17: Type alias cannot be used as a base class [invalid_base] +./aliases_type_statement.py:31:21: Second argument to "isinstance" cannot be a type alias [incompatible_argument] +./aliases_type_statement.py:48:22: Annotated[type 'list', (<+list is_truthy None> == NullConstraint())] is always True because it does not provide __bool__ [type_always_true] +./aliases_type_statement.py:53:22: Type alias cannot combine old-style TypeVar declarations with type statement parameters [invalid_type_alias] +./aliases_type_statement.py:58:16: Type alias must declare type parameters in the type statement [invalid_type_alias] +./aliases_type_statement.py:68:6: Type argument str is not compatible with ~S@./aliases_type_statement.py.RecursiveTypeAlias2 [invalid_specialization] +./aliases_type_statement.py:70:6: Type argument int is not compatible with ~T@./aliases_type_statement.py.RecursiveTypeAlias2 [invalid_specialization] +./aliases_type_statement.py:73:0: Type alias RecursiveTypeAlias3 has a circular definition [invalid_type_alias] +./aliases_type_statement.py:75:0: Type alias RecursiveTypeAlias4 has a circular definition [invalid_type_alias] +./aliases_type_statement.py:79:0: Type alias RecursiveTypeAlias6 has a circular definition [invalid_type_alias] +./aliases_type_statement.py:80:0: Type alias RecursiveTypeAlias7 has a circular definition [invalid_type_alias] +""" diff --git a/conformance/results/pycroscope/aliases_typealiastype.toml b/conformance/results/pycroscope/aliases_typealiastype.toml new file mode 100644 index 00000000..2708a2ee --- /dev/null +++ b/conformance/results/pycroscope/aliases_typealiastype.toml @@ -0,0 +1,34 @@ +conformant = "Partial" +notes = """ +Rejects valid ParamSpec specialization. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 39: Unexpected errors ["./aliases_typealiastype.py:39:4: Unrecognized annotation [invalid_annotation]"] +""" +output = """ +./aliases_typealiastype.py:32:6: typing.TypeAliasType has no attribute 'other_attrib' [undefined_attribute] +./aliases_typealiastype.py:39:4: Unrecognized annotation [invalid_annotation] +./aliases_typealiastype.py:40:4: Type argument int is not compatible with ~TStr@./aliases_typealiastype.py.GoodAlias5 [invalid_specialization] +./aliases_typealiastype.py:43:44: Type alias cannot combine old-style TypeVar declarations with type statement parameters [invalid_type_alias] +./aliases_typealiastype.py:44:44: Type alias must declare type parameters in the type statement [invalid_type_alias] +./aliases_typealiastype.py:45:56: type_params argument to TypeAliasType must be a literal tuple [invalid_type_alias] +./aliases_typealiastype.py:46:0: Type alias BadAlias4 has a circular definition [invalid_type_alias] +./aliases_typealiastype.py:47:0: Type alias BadAlias5 has a circular definition [invalid_type_alias] +./aliases_typealiastype.py:48:0: Type alias BadAlias6 has a circular definition [invalid_type_alias] +./aliases_typealiastype.py:49:0: Type alias BadAlias7 has a circular definition [invalid_type_alias] +./aliases_typealiastype.py:52:39: Invalid type annotation [invalid_annotation] +./aliases_typealiastype.py:53:39: Unrecognized annotation [invalid_annotation] +./aliases_typealiastype.py:54:41: Unrecognized annotation tuple[tuple[type 'int', type 'str']] [invalid_annotation] +./aliases_typealiastype.py:55:41: Invalid type annotation [invalid_annotation] +./aliases_typealiastype.py:56:41: Unrecognized annotation [invalid_annotation] +./aliases_typealiastype.py:57:41: Invalid type annotation [invalid_annotation] +./aliases_typealiastype.py:58:41: Cannot resolve subscripted annotation: [invalid_annotation] +./aliases_typealiastype.py:59:41: Invalid type annotation [invalid_annotation] +./aliases_typealiastype.py:60:41: Invalid type annotation 3 [invalid_annotation] +./aliases_typealiastype.py:61:41: Invalid type annotation True [invalid_annotation] +./aliases_typealiastype.py:62:41: Invalid type annotation 1 [invalid_annotation] +./aliases_typealiastype.py:63:41: Invalid type annotation [invalid_annotation] +./aliases_typealiastype.py:64:41: Invalid type annotation [invalid_annotation] +./aliases_typealiastype.py:66:0: Type alias BadAlias21 has a circular definition [invalid_type_alias] +""" diff --git a/conformance/results/pycroscope/aliases_variance.toml b/conformance/results/pycroscope/aliases_variance.toml new file mode 100644 index 00000000..9b84c03c --- /dev/null +++ b/conformance/results/pycroscope/aliases_variance.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./aliases_variance.py:24:15: T_co has incompatible variance in base class [invalid_base] +./aliases_variance.py:28:15: T_co has incompatible variance in base class [invalid_base] +./aliases_variance.py:32:15: T_co has incompatible variance in base class [invalid_base] +./aliases_variance.py:44:15: T_contra has incompatible variance in base class [invalid_base] +""" diff --git a/conformance/results/pycroscope/annotations_coroutines.toml b/conformance/results/pycroscope/annotations_coroutines.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/annotations_coroutines.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/annotations_forward_refs.toml b/conformance/results/pycroscope/annotations_forward_refs.toml new file mode 100644 index 00000000..11cedda9 --- /dev/null +++ b/conformance/results/pycroscope/annotations_forward_refs.toml @@ -0,0 +1,48 @@ +conformant = "Partial" +notes = """ +Fails to reject "x" | int annotations that fail at runtime. +Rejects some valid quoted annotations. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 14: Unexpected errors ['./annotations_forward_refs.py:14:8: Undefined name: ClassA [undefined_name]', './annotations_forward_refs.py:14:22: Undefined name: ClassA [undefined_name]', './annotations_forward_refs.py:14:42: Undefined name: ClassA [undefined_name]', './annotations_forward_refs.py:14:62: Undefined name: ClassA [undefined_name]'] +Line 16: Unexpected errors ['./annotations_forward_refs.py:16:16: Any[error] is not equivalent to ./annotations_forward_refs.py.ClassA'] +Line 17: Unexpected errors ['./annotations_forward_refs.py:17:16: list[Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA]'] +Line 18: Unexpected errors ['./annotations_forward_refs.py:18:16: list[Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA]'] +Line 19: Unexpected errors ['./annotations_forward_refs.py:19:16: list[int | Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA | int]'] +Line 87: Unexpected errors ['./annotations_forward_refs.py:87:7: Unrecognized annotation (self: ./annotations_forward_refs.py.ClassD) -> None [invalid_annotation]'] +Line 96: Unexpected errors ['./annotations_forward_refs.py:96:12: Any[error] is not equivalent to int'] +""" +output = """ +./annotations_forward_refs.py:14:8: Undefined name: ClassA [undefined_name] +./annotations_forward_refs.py:14:22: Undefined name: ClassA [undefined_name] +./annotations_forward_refs.py:14:42: Undefined name: ClassA [undefined_name] +./annotations_forward_refs.py:14:62: Undefined name: ClassA [undefined_name] +./annotations_forward_refs.py:16:16: Any[error] is not equivalent to ./annotations_forward_refs.py.ClassA +./annotations_forward_refs.py:17:16: list[Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA] +./annotations_forward_refs.py:18:16: list[Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA] +./annotations_forward_refs.py:19:16: list[int | Any[error]] is not equivalent to list[./annotations_forward_refs.py.ClassA | int] +./annotations_forward_refs.py:22:6: Undefined name: ClassA [undefined_name] +./annotations_forward_refs.py:23:11: Undefined name: ClassA [undefined_name] +./annotations_forward_refs.py:41:0: Invalid type annotation [invalid_annotation] +./annotations_forward_refs.py:42:8: Unrecognized annotation [invalid_annotation] +./annotations_forward_refs.py:43:8: Unrecognized annotation tuple[type 'int', type 'str'] [invalid_annotation] +./annotations_forward_refs.py:44:0: Invalid type annotation [invalid_annotation] +./annotations_forward_refs.py:45:8: Unrecognized annotation [invalid_annotation] +./annotations_forward_refs.py:46:0: Invalid type annotation [invalid_annotation] +./annotations_forward_refs.py:47:8: Cannot resolve subscripted annotation: [invalid_annotation] +./annotations_forward_refs.py:48:0: Invalid type annotation [invalid_annotation] +./annotations_forward_refs.py:49:8: Invalid type annotation 1 [invalid_annotation] +./annotations_forward_refs.py:50:9: Invalid type annotation True [invalid_annotation] +./annotations_forward_refs.py:51:9: Invalid type annotation 1 [invalid_annotation] +./annotations_forward_refs.py:52:9: Invalid type annotation -1 [invalid_annotation] +./annotations_forward_refs.py:53:0: Invalid type annotation [invalid_annotation] +./annotations_forward_refs.py:54:0: Invalid type annotation [invalid_annotation] +./annotations_forward_refs.py:55:9: Invalid type annotation [invalid_annotation] +./annotations_forward_refs.py:80:12: Undefined name: ClassF [undefined_name] +./annotations_forward_refs.py:87:7: Unrecognized annotation (self: ./annotations_forward_refs.py.ClassD) -> None [invalid_annotation] +./annotations_forward_refs.py:89:7: Unrecognized annotation (self: ./annotations_forward_refs.py.ClassD) -> None [invalid_annotation] +./annotations_forward_refs.py:96:12: Any[error] is not equivalent to int +""" diff --git a/conformance/results/pycroscope/annotations_generators.toml b/conformance/results/pycroscope/annotations_generators.toml new file mode 100644 index 00000000..44a1909d --- /dev/null +++ b/conformance/results/pycroscope/annotations_generators.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./annotations_generators.py:51:0: Function may exit without returning a value [missing_return] +./annotations_generators.py:54:8: Incompatible return type: expected annotations_generators.C, got Literal[False] [incompatible_return_value] +./annotations_generators.py:57:8: Cannot assign value of type Literal[3] to yield expression of type annotations_generators.A [incompatible_yield] +./annotations_generators.py:66:8: Cannot assign value of type Literal[3] to yield expression of type annotations_generators.A [incompatible_yield] +./annotations_generators.py:71:4: Incompatible return type: expected None, got Literal[True] [incompatible_return_value] +./annotations_generators.py:75:4: Cannot assign value of type annotations_generators.B to yield expression of type annotations_generators.A [incompatible_yield] +./annotations_generators.py:86:20: Generator function must return an iterable [generator_return] +./annotations_generators.py:91:26: Async generator function must return an async iterable [generator_return] +./annotations_generators.py:118:4: Cannot yield from collections.abc.Iterator[annotations_generators.A] (expected annotations_generators.B) [incompatible_yield] +./annotations_generators.py:119:4: Cannot yield from Literal[[1]] (expected annotations_generators.B) [incompatible_yield] +./annotations_generators.py:135:4: Cannot send int to a generator (expected str) [incompatible_yield] +""" diff --git a/conformance/results/pycroscope/annotations_methods.toml b/conformance/results/pycroscope/annotations_methods.toml new file mode 100644 index 00000000..abfcc72e --- /dev/null +++ b/conformance/results/pycroscope/annotations_methods.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./annotations_methods.py:42:12: annotations_methods.B is not equivalent to annotations_methods.A +""" diff --git a/conformance/results/pycroscope/annotations_typeexpr.toml b/conformance/results/pycroscope/annotations_typeexpr.toml new file mode 100644 index 00000000..d323d569 --- /dev/null +++ b/conformance/results/pycroscope/annotations_typeexpr.toml @@ -0,0 +1,24 @@ +conformant = "Partial" +notes = """ +Fails to reject various weird annotations +""" +conformance_automated = "Fail" +errors_diff = """ +Line 88: Expected 1 errors +Line 93: Expected 1 errors +Line 94: Expected 1 errors +Line 95: Expected 1 errors +Line 100: Expected 1 errors +Line 101: Expected 1 errors +""" +output = """ +./annotations_typeexpr.py:89:8: Invalid type annotation [, ] [invalid_annotation] +./annotations_typeexpr.py:90:8: Invalid type annotation (, ) [invalid_annotation] +./annotations_typeexpr.py:91:8: Unrecognized annotation [invalid_annotation] +./annotations_typeexpr.py:92:8: Invalid type annotation {} [invalid_annotation] +./annotations_typeexpr.py:96:8: Invalid type annotation 3 [invalid_annotation] +./annotations_typeexpr.py:97:9: Invalid type annotation True [invalid_annotation] +./annotations_typeexpr.py:98:9: Invalid type annotation 1 [invalid_annotation] +./annotations_typeexpr.py:99:9: Invalid type annotation -1 [invalid_annotation] +./annotations_typeexpr.py:102:9: Invalid type annotation [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/callables_annotation.toml b/conformance/results/pycroscope/callables_annotation.toml new file mode 100644 index 00000000..2de3e278 --- /dev/null +++ b/conformance/results/pycroscope/callables_annotation.toml @@ -0,0 +1,21 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./callables_annotation.py:25:4: Missing required positional argument at position 1 [incompatible_call] +./callables_annotation.py:26:10: Incompatible argument type for @1: expected str but got Literal[2] [incompatible_argument] +./callables_annotation.py:27:4: Takes 2 positional arguments but 3 were given [incompatible_call] +./callables_annotation.py:29:4: Missing required positional argument at position 0 [incompatible_call] +./callables_annotation.py:35:4: Takes 0 positional arguments but 1 were given [incompatible_call] +./callables_annotation.py:55:4: Callable[] requires exactly two arguments [invalid_annotation] +./callables_annotation.py:56:4: Invalid arguments to Callable: [invalid_annotation] +./callables_annotation.py:57:4: Invalid type annotation [] [invalid_annotation] +./callables_annotation.py:58:4: Callable[] requires exactly two arguments [invalid_annotation] +./callables_annotation.py:59:4: Ellipsis must be used directly in Callable[..., T], not in Callable[[...], T] [invalid_annotation] +./callables_annotation.py:91:0: Incompatible assignment: expected (int, /, **Any[explicit]) -> str, got () -> str [incompatible_assignment] +./callables_annotation.py:93:0: Incompatible assignment: expected (int, /, **Any[explicit]) -> str, got (*, a: int) -> str [incompatible_assignment] +./callables_annotation.py:159:4: Incompatible assignment: expected ./callables_annotation.py.Proto5[Any[explicit]], got ./callables_annotation.py.Proto8 [incompatible_assignment] +./callables_annotation.py:172:4: Incompatible assignment: expected .Callback2[Any[ellipsis_callable]] = (int, /, ****P) -> str, got () -> str [incompatible_assignment] +./callables_annotation.py:187:4: Incompatible assignment: expected (str, /, **Any[explicit]) -> str, got (int, str, /) -> str [incompatible_assignment] +./callables_annotation.py:189:4: Incompatible assignment: expected .CallbackWithStr[Any[ellipsis_callable]] = (str, /, ****P) -> str, got (int, str, /) -> str [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/callables_kwargs.toml b/conformance/results/pycroscope/callables_kwargs.toml new file mode 100644 index 00000000..492f041f --- /dev/null +++ b/conformance/results/pycroscope/callables_kwargs.toml @@ -0,0 +1,19 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./callables_kwargs.py:46:4: In call to callables_kwargs.func1: Missing required argument 'v1' [incompatible_call] +./callables_kwargs.py:51:4: In call to callables_kwargs.func1: Got an unexpected keyword argument 'v4' [incompatible_call] +./callables_kwargs.py:52:4: In call to callables_kwargs.func1: Missing required argument 'v1' [incompatible_call] +./callables_kwargs.py:58:4: Incompatible argument type for v1: expected int but got str [incompatible_argument] +./callables_kwargs.py:61:4: In call to callables_kwargs.func1: Got an unexpected keyword argument 'v4' [incompatible_call] +./callables_kwargs.py:63:4: Multiple values provided for argument 'v1' [incompatible_call] +./callables_kwargs.py:64:4: In call to callables_kwargs.func2: Parameter 'v3' provided as both a positional and a keyword argument [incompatible_call] +./callables_kwargs.py:65:4: Multiple values provided for argument 'v1' [incompatible_call] +./callables_kwargs.py:101:0: Incompatible assignment: expected callables_kwargs.TDProtocol3, got function 'callables_kwargs.func1' [incompatible_assignment] +./callables_kwargs.py:102:0: Incompatible assignment: expected callables_kwargs.TDProtocol4, got function 'callables_kwargs.func1' [incompatible_assignment] +./callables_kwargs.py:103:0: Incompatible assignment: expected callables_kwargs.TDProtocol5, got function 'callables_kwargs.func1' [incompatible_assignment] +./callables_kwargs.py:111:21: Parameter v1 overlaps with TypedDict key in **kwargs [invalid_annotation] +./callables_kwargs.py:122:12: Expected TypedDict type inside Unpack[] for **kwargs [invalid_annotation] +./callables_kwargs.py:134:0: Incompatible assignment: expected callables_kwargs.TDProtocol6, got function 'callables_kwargs.func7' [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/callables_protocol.toml b/conformance/results/pycroscope/callables_protocol.toml new file mode 100644 index 00000000..658e045a --- /dev/null +++ b/conformance/results/pycroscope/callables_protocol.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./callables_protocol.py:35:0: Incompatible assignment: expected ./callables_protocol.py.Proto1, got (*vals: tuple[bytes, ...], max_items: int | None) -> list[bytes] [incompatible_assignment] +./callables_protocol.py:36:0: Incompatible assignment: expected ./callables_protocol.py.Proto1, got (*vals: tuple[bytes, ...]) -> list[bytes] [incompatible_assignment] +./callables_protocol.py:37:0: Incompatible assignment: expected ./callables_protocol.py.Proto1, got (*vals: tuple[bytes, ...], max_len: str | None) -> list[bytes] [incompatible_assignment] +./callables_protocol.py:67:0: Incompatible assignment: expected ./callables_protocol.py.Proto2, got (*a: tuple[bytes, ...]) -> Any[unannotated] [incompatible_assignment] +./callables_protocol.py:68:0: Incompatible assignment: expected ./callables_protocol.py.Proto2, got (*a: tuple[str, ...], **b: dict[str, str]) -> Any[unannotated] [incompatible_assignment] +./callables_protocol.py:69:0: Incompatible assignment: expected ./callables_protocol.py.Proto2, got (*a: tuple[bytes, ...], **b: dict[str, bytes]) -> Any[unannotated] [incompatible_assignment] +./callables_protocol.py:70:0: Incompatible assignment: expected ./callables_protocol.py.Proto2, got (**b: dict[str, str]) -> Any[unannotated] [incompatible_assignment] +./callables_protocol.py:97:0: Incompatible assignment: expected ./callables_protocol.py.Proto4, got (x: int) -> None [incompatible_assignment] +./callables_protocol.py:121:0: Incompatible assignment: expected ./callables_protocol.py.NotProto6, got (*vals: tuple[bytes, ...], max_len: int | None = None) -> list[bytes] [incompatible_assignment] +./callables_protocol.py:169:0: Incompatible assignment: expected ./callables_protocol.py.Proto8, got (x: int) -> Any[explicit] [incompatible_assignment] +./callables_protocol.py:186:4: Incompatible types in assignment to attribute 'other_attribute': expected int, got Literal['str'] [incompatible_assignment] +./callables_protocol.py:187:4: ./callables_protocol.py.Proto9[**P@./callables_protocol.py.decorator1..decorator1, +R@./callables_protocol.py.decorator1..decorator1] has no attribute 'xxx' [undefined_attribute] +./callables_protocol.py:197:6: ./callables_protocol.py.Proto9[(x: int) -> Any[unannotated], str] has no attribute 'other_attribute2' [undefined_attribute] +./callables_protocol.py:238:0: Incompatible assignment: expected ./callables_protocol.py.Proto11, got (x: int, y: str, /) -> Any[explicit] [incompatible_assignment] +./callables_protocol.py:260:0: Incompatible assignment: expected ./callables_protocol.py.Proto12, got (*args: tuple[Any[explicit], ...], kwarg0: Any[explicit]) -> None [incompatible_assignment] +./callables_protocol.py:284:0: Incompatible assignment: expected ./callables_protocol.py.Proto13_Default, got (path: str) -> str [incompatible_assignment] +./callables_protocol.py:311:0: Incompatible assignment: expected ./callables_protocol.py.Proto14_Default, got (*, path: str) -> str [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/callables_subtyping.toml b/conformance/results/pycroscope/callables_subtyping.toml new file mode 100644 index 00000000..548cae50 --- /dev/null +++ b/conformance/results/pycroscope/callables_subtyping.toml @@ -0,0 +1,37 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./callables_subtyping.py:26:4: Incompatible assignment: expected (float | int, /) -> float | int, got (int, /) -> int [incompatible_assignment] +./callables_subtyping.py:29:4: Incompatible assignment: expected (int, /) -> int, got (float | int, /) -> float | int [incompatible_assignment] +./callables_subtyping.py:51:4: Incompatible assignment: expected callables_subtyping.Standard2, got callables_subtyping.PosOnly2 [incompatible_assignment] +./callables_subtyping.py:52:4: Incompatible assignment: expected callables_subtyping.Standard2, got callables_subtyping.KwOnly2 [incompatible_assignment] +./callables_subtyping.py:55:4: Incompatible assignment: expected callables_subtyping.PosOnly2, got callables_subtyping.KwOnly2 [incompatible_assignment] +./callables_subtyping.py:58:4: Incompatible assignment: expected callables_subtyping.KwOnly2, got callables_subtyping.PosOnly2 [incompatible_assignment] +./callables_subtyping.py:82:4: Incompatible assignment: expected callables_subtyping.IntArgs3, got callables_subtyping.NoArgs3 [incompatible_assignment] +./callables_subtyping.py:85:4: Incompatible assignment: expected callables_subtyping.FloatArgs3, got callables_subtyping.NoArgs3 [incompatible_assignment] +./callables_subtyping.py:86:4: Incompatible assignment: expected callables_subtyping.FloatArgs3, got callables_subtyping.IntArgs3 [incompatible_assignment] +./callables_subtyping.py:116:4: Incompatible assignment: expected callables_subtyping.PosOnly4, got callables_subtyping.IntArgs4 [incompatible_assignment] +./callables_subtyping.py:119:4: Incompatible assignment: expected callables_subtyping.IntStrArgs4, got callables_subtyping.StrArgs4 [incompatible_assignment] +./callables_subtyping.py:120:4: Incompatible assignment: expected callables_subtyping.IntStrArgs4, got callables_subtyping.IntArgs4 [incompatible_assignment] +./callables_subtyping.py:122:4: Incompatible assignment: expected callables_subtyping.StrArgs4, got callables_subtyping.IntArgs4 [incompatible_assignment] +./callables_subtyping.py:124:4: Incompatible assignment: expected callables_subtyping.IntArgs4, got callables_subtyping.StrArgs4 [incompatible_assignment] +./callables_subtyping.py:125:4: Incompatible assignment: expected callables_subtyping.Standard4, got callables_subtyping.IntStrArgs4 [incompatible_assignment] +./callables_subtyping.py:126:4: Incompatible assignment: expected callables_subtyping.Standard4, got callables_subtyping.StrArgs4 [incompatible_assignment] +./callables_subtyping.py:151:4: Incompatible assignment: expected callables_subtyping.IntKwargs5, got callables_subtyping.NoKwargs5 [incompatible_assignment] +./callables_subtyping.py:154:4: Incompatible assignment: expected callables_subtyping.FloatKwargs5, got callables_subtyping.NoKwargs5 [incompatible_assignment] +./callables_subtyping.py:155:4: Incompatible assignment: expected callables_subtyping.FloatKwargs5, got callables_subtyping.IntKwargs5 [incompatible_assignment] +./callables_subtyping.py:187:4: Incompatible assignment: expected callables_subtyping.KwOnly6, got callables_subtyping.IntKwargs6 [incompatible_assignment] +./callables_subtyping.py:190:4: Incompatible assignment: expected callables_subtyping.IntStrKwargs6, got callables_subtyping.StrKwargs6 [incompatible_assignment] +./callables_subtyping.py:191:4: Incompatible assignment: expected callables_subtyping.IntStrKwargs6, got callables_subtyping.IntKwargs6 [incompatible_assignment] +./callables_subtyping.py:193:4: Incompatible assignment: expected callables_subtyping.StrKwargs6, got callables_subtyping.IntKwargs6 [incompatible_assignment] +./callables_subtyping.py:195:4: Incompatible assignment: expected callables_subtyping.IntKwargs6, got callables_subtyping.StrKwargs6 [incompatible_assignment] +./callables_subtyping.py:196:4: Incompatible assignment: expected callables_subtyping.Standard6, got callables_subtyping.IntStrKwargs6 [incompatible_assignment] +./callables_subtyping.py:197:4: Incompatible assignment: expected callables_subtyping.Standard6, got callables_subtyping.StrKwargs6 [incompatible_assignment] +./callables_subtyping.py:236:4: Incompatible assignment: expected callables_subtyping.DefaultArg8, got callables_subtyping.NoDefaultArg8 [incompatible_assignment] +./callables_subtyping.py:237:4: Incompatible assignment: expected callables_subtyping.DefaultArg8, got callables_subtyping.NoX8 [incompatible_assignment] +./callables_subtyping.py:240:4: Incompatible assignment: expected callables_subtyping.NoDefaultArg8, got callables_subtyping.NoX8 [incompatible_assignment] +./callables_subtyping.py:243:4: Incompatible assignment: expected callables_subtyping.NoX8, got callables_subtyping.NoDefaultArg8 [incompatible_assignment] +./callables_subtyping.py:273:4: Incompatible assignment: expected callables_subtyping.FloatArg9, got callables_subtyping.Overloaded9 [incompatible_assignment] +./callables_subtyping.py:297:4: Incompatible assignment: expected callables_subtyping.Overloaded10, got callables_subtyping.StrArg10 [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/classes_classvar.toml b/conformance/results/pycroscope/classes_classvar.toml new file mode 100644 index 00000000..a377b105 --- /dev/null +++ b/conformance/results/pycroscope/classes_classvar.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./classes_classvar.py:38:10: Invalid type annotation (, ) [invalid_annotation] +./classes_classvar.py:39:10: Invalid type annotation 3 [invalid_annotation] +./classes_classvar.py:40:13: Undefined name: var [undefined_name] +./classes_classvar.py:45:10: ClassVar type cannot include type parameters [classvar_type_parameters] +./classes_classvar.py:46:10: ClassVar type cannot include type parameters [classvar_type_parameters] +./classes_classvar.py:47:10: ClassVar type cannot include type parameters [classvar_type_parameters] +./classes_classvar.py:52:4: Incompatible assignment: expected list[str], got Literal[{}] [incompatible_assignment] +./classes_classvar.py:54:10: Final cannot be combined with ClassVar [invalid_qualifier] +./classes_classvar.py:55:11: Unrecognized annotation typing.ClassVar[] [invalid_annotation] +./classes_classvar.py:69:25: Unexpected ClassVar annotation [invalid_qualifier] +./classes_classvar.py:70:11: ClassVar can only be used for assignments in class body [invalid_qualifier] +./classes_classvar.py:71:17: ClassVar can only be used for assignments in class body [invalid_qualifier] +./classes_classvar.py:73:25: Unexpected ClassVar annotation [invalid_qualifier] +./classes_classvar.py:77:7: ClassVar can only be used for assignments in class body [invalid_qualifier] +./classes_classvar.py:78:19: ClassVar cannot be used in type aliases [invalid_qualifier] +./classes_classvar.py:111:0: Cannot assign to class variable 'stats' via instance [incompatible_assignment] +./classes_classvar.py:140:0: Incompatible assignment: expected ./classes_classvar.py.ProtoA, got ./classes_classvar.py.ProtoAImpl [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/classes_override.toml b/conformance/results/pycroscope/classes_override.toml new file mode 100644 index 00000000..b73910e7 --- /dev/null +++ b/conformance/results/pycroscope/classes_override.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./classes_override.py:53:4: Method does not override any base method [override_does_not_override] +./classes_override.py:65:4: Method does not override any base method [override_does_not_override] +./classes_override.py:79:4: Method does not override any base method [override_does_not_override] +./classes_override.py:84:4: Method does not override any base method [override_does_not_override] +./classes_override.py:89:4: Method does not override any base method [override_does_not_override] +""" diff --git a/conformance/results/pycroscope/constructors_call_init.toml b/conformance/results/pycroscope/constructors_call_init.toml new file mode 100644 index 00000000..da605980 --- /dev/null +++ b/conformance/results/pycroscope/constructors_call_init.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./constructors_call_init.py:21:12: Incompatible argument type for x: expected int but got Literal[1.0] [incompatible_argument] +./constructors_call_init.py:42:7: Incompatible argument type for x: expected ./constructors_call_init.py.Class3 | None but got ./constructors_call_init.py.Class2 [incompatible_argument] +./constructors_call_init.py:56:0: Missing required positional argument '%self' [incompatible_call] +./constructors_call_init.py:107:17: Class-scoped type variables are not allowed in __init__ self annotation [invalid_self_usage] +./constructors_call_init.py:130:0: Takes 0 positional arguments but 1 were given [incompatible_call] +""" diff --git a/conformance/results/pycroscope/constructors_call_metaclass.toml b/conformance/results/pycroscope/constructors_call_metaclass.toml new file mode 100644 index 00000000..2ec970e1 --- /dev/null +++ b/conformance/results/pycroscope/constructors_call_metaclass.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./constructors_call_metaclass.py:54:0: Missing required argument 'x' [incompatible_call] +./constructors_call_metaclass.py:68:0: Missing required argument 'x' [incompatible_call] +""" diff --git a/conformance/results/pycroscope/constructors_call_new.toml b/conformance/results/pycroscope/constructors_call_new.toml new file mode 100644 index 00000000..b747f222 --- /dev/null +++ b/conformance/results/pycroscope/constructors_call_new.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./constructors_call_new.py:21:12: Incompatible argument type for x: expected int but got Literal[1.0] [incompatible_argument] +./constructors_call_new.py:148:0: Missing required positional argument '%self' [incompatible_call] +""" diff --git a/conformance/results/pycroscope/constructors_call_type.toml b/conformance/results/pycroscope/constructors_call_type.toml new file mode 100644 index 00000000..1391f747 --- /dev/null +++ b/conformance/results/pycroscope/constructors_call_type.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./constructors_call_type.py:30:4: In call to constructors_call_type.Meta1.__call__: Missing required argument 'x' [incompatible_call] +./constructors_call_type.py:40:4: In call to constructors_call_type.Class2: Missing required argument 'x' [incompatible_call] +./constructors_call_type.py:50:4: In call to constructors_call_type.Class3: Missing required argument 'x' [incompatible_call] +./constructors_call_type.py:59:4: In call to constructors_call_type.Class4: Takes 0 positional arguments but 1 were given [incompatible_call] +./constructors_call_type.py:64:4: Takes 0 positional arguments but 1 were given [incompatible_call] +./constructors_call_type.py:72:4: In call to constructors_call_type.Meta1.__call__: Missing required argument 'x' [incompatible_call] +./constructors_call_type.py:81:4: In call to constructors_call_type.Class2: Missing required argument 'y' [incompatible_call] +./constructors_call_type.py:82:11: Incompatible argument type for y: expected str but got Literal[2] [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/constructors_callable.toml b/conformance/results/pycroscope/constructors_callable.toml new file mode 100644 index 00000000..3c01c1f1 --- /dev/null +++ b/conformance/results/pycroscope/constructors_callable.toml @@ -0,0 +1,27 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./constructors_callable.py:36:12: Revealed type is '(x: int) -> ./constructors_callable.py.Class1' [reveal_type] +./constructors_callable.py:38:0: Missing required argument 'x' [incompatible_call] +./constructors_callable.py:39:0: Missing required argument 'x' [incompatible_call] +./constructors_callable.py:49:12: Revealed type is '() -> ./constructors_callable.py.Class2' [reveal_type] +./constructors_callable.py:51:0: Takes 0 positional arguments but 1 were given [incompatible_call] +./constructors_callable.py:64:12: Revealed type is '(x: int) -> ./constructors_callable.py.Class3' [reveal_type] +./constructors_callable.py:66:0: Missing required argument 'x' [incompatible_call] +./constructors_callable.py:67:0: Missing required argument 'x' [incompatible_call] +./constructors_callable.py:68:0: Takes 1 positional arguments but 2 were given [incompatible_call] +./constructors_callable.py:79:12: Revealed type is '(x: int) -> int' [reveal_type] +./constructors_callable.py:81:0: Missing required argument 'x' [incompatible_call] +./constructors_callable.py:82:0: Missing required argument 'x' [incompatible_call] +./constructors_callable.py:99:12: Revealed type is '(*args: tuple[Any[ellipsis_callable], ...], **kwargs: dict[str, Any[ellipsis_callable]]) -> Never' [reveal_type] +./constructors_callable.py:127:12: Revealed type is '() -> ./constructors_callable.py.Class6Proxy' [reveal_type] +./constructors_callable.py:129:0: Takes 0 positional arguments but 1 were given [incompatible_call] +./constructors_callable.py:144:12: Revealed type is '() -> Any[explicit]' [reveal_type] +./constructors_callable.py:146:0: Takes 0 positional arguments but 1 were given [incompatible_call] +./constructors_callable.py:164:4: Revealed type is '(x: ~_Ctor_Class7_T) -> ./constructors_callable.py.Class7[~_Ctor_Class7_T]' [reveal_type] +./constructors_callable.py:184:12: Revealed type is '(x: list[~T@./constructors_callable.py.Class8], y: list[~T@./constructors_callable.py.Class8]) -> ./constructors_callable.py.Class8[~T@./constructors_callable.py.Class8]' [reveal_type] +./constructors_callable.py:186:0: Cannot resolve type variables [incompatible_call] +./constructors_callable.py:195:12: Revealed type is '(x: list[~T@./constructors_callable.py.Class9.__init__..__init__], y: list[~T@./constructors_callable.py.Class9.__init__..__init__]) -> ./constructors_callable.py.Class9' [reveal_type] +./constructors_callable.py:197:0: Cannot resolve type variables [incompatible_call] +""" diff --git a/conformance/results/pycroscope/constructors_consistency.toml b/conformance/results/pycroscope/constructors_consistency.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/constructors_consistency.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/dataclasses_descriptors.toml b/conformance/results/pycroscope/dataclasses_descriptors.toml new file mode 100644 index 00000000..e5410991 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_descriptors.toml @@ -0,0 +1,23 @@ +conformant = "Partial" +notes = """ +Conformance suite is questionable; see https://github.com/python/typing/issues/2259 +""" +conformance_automated = "Fail" +errors_diff = """ +Line 61: Unexpected errors ['./dataclasses_descriptors.py:61:12: Any[error] is not equivalent to list[int]', "./dataclasses_descriptors.py:61:12: has no attribute 'x' [undefined_attribute]"] +Line 62: Unexpected errors ['./dataclasses_descriptors.py:62:12: Any[error] is not equivalent to list[str]', "./dataclasses_descriptors.py:62:12: has no attribute 'y' [undefined_attribute]"] +Line 63: Unexpected errors ['./dataclasses_descriptors.py:63:12: list[Any[generic_argument]] is not equivalent to list[str]'] +Line 66: Unexpected errors ['./dataclasses_descriptors.py:66:12: ./dataclasses_descriptors.py.Desc2[int] is not equivalent to int'] +Line 67: Unexpected errors ['./dataclasses_descriptors.py:67:12: ./dataclasses_descriptors.py.Desc2[str] is not equivalent to str'] +Line 68: Unexpected errors ['./dataclasses_descriptors.py:68:12: Any[generic_argument] is not equivalent to str'] +""" +output = """ +./dataclasses_descriptors.py:61:12: Any[error] is not equivalent to list[int] +./dataclasses_descriptors.py:61:12: has no attribute 'x' [undefined_attribute] +./dataclasses_descriptors.py:62:12: Any[error] is not equivalent to list[str] +./dataclasses_descriptors.py:62:12: has no attribute 'y' [undefined_attribute] +./dataclasses_descriptors.py:63:12: list[Any[generic_argument]] is not equivalent to list[str] +./dataclasses_descriptors.py:66:12: ./dataclasses_descriptors.py.Desc2[int] is not equivalent to int +./dataclasses_descriptors.py:67:12: ./dataclasses_descriptors.py.Desc2[str] is not equivalent to str +./dataclasses_descriptors.py:68:12: Any[generic_argument] is not equivalent to str +""" diff --git a/conformance/results/pycroscope/dataclasses_final.toml b/conformance/results/pycroscope/dataclasses_final.toml new file mode 100644 index 00000000..07f24842 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_final.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_final.py:27:0: Cannot assign to final name final_classvar [incompatible_assignment] +./dataclasses_final.py:35:0: Cannot assign to final name final_no_default [incompatible_assignment] +./dataclasses_final.py:36:0: Cannot assign to final name final_with_default [incompatible_assignment] +./dataclasses_final.py:37:0: Cannot assign to instance attribute 'final_no_default' via class object [incompatible_assignment] +./dataclasses_final.py:38:0: Cannot assign to final name final_with_default [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/dataclasses_frozen.toml b/conformance/results/pycroscope/dataclasses_frozen.toml new file mode 100644 index 00000000..c64b3d31 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_frozen.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_frozen.py:16:0: Cannot assign to attribute a of frozen dataclass ./dataclasses_frozen.py.DC1 [incompatible_assignment] +./dataclasses_frozen.py:17:0: Cannot assign to attribute b of frozen dataclass ./dataclasses_frozen.py.DC1 [incompatible_assignment] +./dataclasses_frozen.py:23:0: Non-frozen dataclass cannot inherit from a frozen dataclass [invalid_base] +./dataclasses_frozen.py:33:0: Frozen dataclass cannot inherit from a non-frozen dataclass [invalid_base] +""" diff --git a/conformance/results/pycroscope/dataclasses_hash.toml b/conformance/results/pycroscope/dataclasses_hash.toml new file mode 100644 index 00000000..ebe2bbf7 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_hash.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_hash.py:17:0: None is not callable [not_callable] +./dataclasses_hash.py:18:0: Incompatible assignment: expected pycroscope.relations.HashableProto, got ./dataclasses_hash.py.DC1 [incompatible_assignment] +./dataclasses_hash.py:39:0: None is not callable [not_callable] +./dataclasses_hash.py:40:0: Incompatible assignment: expected pycroscope.relations.HashableProto, got ./dataclasses_hash.py.DC3 [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/dataclasses_inheritance.toml b/conformance/results/pycroscope/dataclasses_inheritance.toml new file mode 100644 index 00000000..5c74e15a --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_inheritance.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_inheritance.py:62:4: Value of x incompatible with base class ./dataclasses_inheritance.py.DC6 [incompatible_override] +./dataclasses_inheritance.py:66:4: Value of y incompatible with base class ./dataclasses_inheritance.py.DC6 [incompatible_override] +""" diff --git a/conformance/results/pycroscope/dataclasses_kwonly.toml b/conformance/results/pycroscope/dataclasses_kwonly.toml new file mode 100644 index 00000000..55ead395 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_kwonly.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_kwonly.py:23:0: Takes 1 positional arguments but 2 were given [incompatible_call] +./dataclasses_kwonly.py:38:0: Takes 1 positional arguments but 2 were given [incompatible_call] +./dataclasses_kwonly.py:53:0: Takes 1 positional arguments but 2 were given [incompatible_call] +""" diff --git a/conformance/results/pycroscope/dataclasses_match_args.toml b/conformance/results/pycroscope/dataclasses_match_args.toml new file mode 100644 index 00000000..6b3009b7 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_match_args.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_match_args.py:42:0: has no attribute '__match_args__' [undefined_attribute] +""" diff --git a/conformance/results/pycroscope/dataclasses_order.toml b/conformance/results/pycroscope/dataclasses_order.toml new file mode 100644 index 00000000..69aaa4a3 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_order.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_order.py:50:3: Unsupported operands for less than: ./dataclasses_order.py.DC1 and ./dataclasses_order.py.DC2 [unsupported_operation] +""" diff --git a/conformance/results/pycroscope/dataclasses_postinit.toml b/conformance/results/pycroscope/dataclasses_postinit.toml new file mode 100644 index 00000000..225afffc --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_postinit.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_postinit.py:19:4: Dataclass __post_init__ is incompatible with InitVar fields [incompatible_override] +./dataclasses_postinit.py:28:6: ./dataclasses_postinit.py.DC1 has no attribute 'x' [undefined_attribute] +./dataclasses_postinit.py:29:6: ./dataclasses_postinit.py.DC1 has no attribute 'y' [undefined_attribute] +./dataclasses_postinit.py:36:4: Dataclass __post_init__ is incompatible with InitVar fields [incompatible_override] +""" diff --git a/conformance/results/pycroscope/dataclasses_slots.toml b/conformance/results/pycroscope/dataclasses_slots.toml new file mode 100644 index 00000000..d89f9404 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_slots.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_slots.py:11:0: Class cannot define __slots__ when dataclass slots=True [invalid_dataclass] +./dataclasses_slots.py:25:8: Cannot assign to attribute 'y'; it is not in __slots__ for ./dataclasses_slots.py.DC2 [incompatible_assignment] +./dataclasses_slots.py:38:8: Cannot assign to attribute 'y'; it is not in __slots__ for ./dataclasses_slots.py.DC3 [incompatible_assignment] +./dataclasses_slots.py:66:0: has no attribute '__slots__' [undefined_attribute] +./dataclasses_slots.py:69:0: ./dataclasses_slots.py.DC6 has no attribute '__slots__' [undefined_attribute] +""" diff --git a/conformance/results/pycroscope/dataclasses_transform_class.toml b/conformance/results/pycroscope/dataclasses_transform_class.toml new file mode 100644 index 00000000..1eab0643 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_transform_class.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_transform_class.py:51:0: Non-frozen dataclass cannot inherit from a frozen dataclass [invalid_base] +./dataclasses_transform_class.py:63:0: Cannot assign to attribute id of frozen dataclass ./dataclasses_transform_class.py.Customer1 [incompatible_assignment] +./dataclasses_transform_class.py:66:7: Missing required argument 'id' [incompatible_call] +./dataclasses_transform_class.py:72:5: Unsupported operands for less than: ./dataclasses_transform_class.py.Customer1 and ./dataclasses_transform_class.py.Customer1 [unsupported_operation] +./dataclasses_transform_class.py:82:7: Missing required argument 'id' [incompatible_call] +./dataclasses_transform_class.py:122:0: Cannot assign to attribute id of frozen dataclass ./dataclasses_transform_class.py.Customer3 [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/dataclasses_transform_converter.toml b/conformance/results/pycroscope/dataclasses_transform_converter.toml new file mode 100644 index 00000000..7db3d21e --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_transform_converter.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_transform_converter.py:48:40: Incompatible argument type for converter: expected (~S, /) -> ~T but got () -> int [incompatible_argument] +./dataclasses_transform_converter.py:49:40: Incompatible argument type for converter: expected (~S, /) -> ~T but got (*, x: int) -> int [incompatible_argument] +./dataclasses_transform_converter.py:107:4: Incompatible argument type for field0: expected str but got Literal[1] [incompatible_argument] +./dataclasses_transform_converter.py:108:22: Incompatible argument type for field3: expected str | bytes but got Literal[1] [incompatible_argument] +./dataclasses_transform_converter.py:109:28: Incompatible argument type for field4: expected str | list[str] but got Literal[3j] [incompatible_argument] +./dataclasses_transform_converter.py:118:0: Incompatible types in assignment to attribute 'field0': expected str, got Literal[1] [incompatible_assignment] +./dataclasses_transform_converter.py:119:0: Incompatible types in assignment to attribute 'field3': expected str | bytes, got Literal[1] [incompatible_assignment] +./dataclasses_transform_converter.py:130:18: Cannot resolve type variables [incompatible_call] +./dataclasses_transform_converter.py:133:18: Cannot resolve type variables [incompatible_call] +""" diff --git a/conformance/results/pycroscope/dataclasses_transform_field.toml b/conformance/results/pycroscope/dataclasses_transform_field.toml new file mode 100644 index 00000000..527ade97 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_transform_field.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_transform_field.py:64:0: Got an unexpected keyword argument 'id' [incompatible_call] +./dataclasses_transform_field.py:75:0: Missing required argument 'name' [incompatible_call] +""" diff --git a/conformance/results/pycroscope/dataclasses_transform_func.toml b/conformance/results/pycroscope/dataclasses_transform_func.toml new file mode 100644 index 00000000..42b222af --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_transform_func.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_transform_func.py:56:0: Incompatible types in assignment to attribute 'name': expected str, got Literal[3] [incompatible_assignment] +./dataclasses_transform_func.py:60:5: Unsupported operands for less than: ./dataclasses_transform_func.py.Customer1 and ./dataclasses_transform_func.py.Customer1 [unsupported_operation] +./dataclasses_transform_func.py:64:7: Got an unexpected keyword argument 'salary' [incompatible_call] +./dataclasses_transform_func.py:70:7: Missing required argument 'id' [incompatible_call] +./dataclasses_transform_func.py:89:0: Non-frozen dataclass cannot inherit from a frozen dataclass [invalid_base] +./dataclasses_transform_func.py:96:0: Cannot assign to attribute id of frozen dataclass ./dataclasses_transform_func.py.Customer3 [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/dataclasses_transform_meta.toml b/conformance/results/pycroscope/dataclasses_transform_meta.toml new file mode 100644 index 00000000..4aff9893 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_transform_meta.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_transform_meta.py:51:0: Non-frozen dataclass cannot inherit from a frozen dataclass [invalid_base] +./dataclasses_transform_meta.py:63:0: Cannot assign to attribute id of frozen dataclass ./dataclasses_transform_meta.py.Customer1 [incompatible_assignment] +./dataclasses_transform_meta.py:66:7: Missing required argument 'id' [incompatible_call] +./dataclasses_transform_meta.py:73:5: Unsupported operands for less than: ./dataclasses_transform_meta.py.Customer1 and ./dataclasses_transform_meta.py.Customer1 [unsupported_operation] +./dataclasses_transform_meta.py:83:7: Missing required argument 'id' [incompatible_call] +./dataclasses_transform_meta.py:103:0: Cannot assign to attribute id of frozen dataclass ./dataclasses_transform_meta.py.Customer3 [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/dataclasses_usage.toml b/conformance/results/pycroscope/dataclasses_usage.toml new file mode 100644 index 00000000..6335d5f1 --- /dev/null +++ b/conformance/results/pycroscope/dataclasses_usage.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./dataclasses_usage.py:50:5: Missing required argument 'unit_price' [incompatible_call] +./dataclasses_usage.py:51:27: Incompatible argument type for unit_price: expected float | int but got Literal['price'] [incompatible_argument] +./dataclasses_usage.py:52:5: Takes 3 positional arguments but 4 were given [incompatible_call] +./dataclasses_usage.py:58:1: Dataclass fields without defaults cannot follow fields with defaults [invalid_dataclass] +./dataclasses_usage.py:64:1: Dataclass fields without defaults cannot follow fields with defaults [invalid_dataclass] +./dataclasses_usage.py:70:1: Dataclass fields without defaults cannot follow fields with defaults [invalid_dataclass] +./dataclasses_usage.py:83:5: Takes 1 positional arguments but 2 were given [incompatible_call] +./dataclasses_usage.py:88:4: Dataclass default_factory return type is incompatible with field type int [incompatible_assignment] +./dataclasses_usage.py:127:0: Takes 1 positional arguments but 2 were given [incompatible_call] +./dataclasses_usage.py:130:0: Missing required argument 'y' [incompatible_call] +./dataclasses_usage.py:179:0: Takes 0 positional arguments but 1 were given [incompatible_call] +""" diff --git a/conformance/results/pycroscope/directives_assert_type.toml b/conformance/results/pycroscope/directives_assert_type.toml new file mode 100644 index 00000000..a1506a6f --- /dev/null +++ b/conformance/results/pycroscope/directives_assert_type.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./directives_assert_type.py:27:16: int | str is not equivalent to int +./directives_assert_type.py:28:16: int | str is not equivalent to Any[explicit] +./directives_assert_type.py:29:16: Any[explicit] is not equivalent to int +./directives_assert_type.py:30:16: Literal[4] is not equivalent to int +./directives_assert_type.py:32:4: In call to typing.assert_type: Missing required positional argument 'val' [incompatible_call] +./directives_assert_type.py:33:16: Literal[''] is not equivalent to int +./directives_assert_type.py:34:4: In call to typing.assert_type: Takes 2 positional arguments but 3 were given [incompatible_call] +""" diff --git a/conformance/results/pycroscope/directives_cast.toml b/conformance/results/pycroscope/directives_cast.toml new file mode 100644 index 00000000..9429a6b9 --- /dev/null +++ b/conformance/results/pycroscope/directives_cast.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./directives_cast.py:15:7: In call to typing.cast: Missing required positional argument 'typ' [incompatible_call] +./directives_cast.py:16:7: Invalid type annotation 1 [invalid_annotation] +./directives_cast.py:17:7: In call to typing.cast: Takes 2 positional arguments but 3 were given [incompatible_call] +""" diff --git a/conformance/results/pycroscope/directives_deprecated.toml b/conformance/results/pycroscope/directives_deprecated.toml new file mode 100644 index 00000000..0aa05c02 --- /dev/null +++ b/conformance/results/pycroscope/directives_deprecated.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./directives_deprecated.py:18:43: type '_directives_deprecated_library.Ham' is deprecated: Use Spam instead [deprecated] +./directives_deprecated.py:24:0: function '_directives_deprecated_library.norwegian_blue' is deprecated: It is pining for the fjords [deprecated] +./directives_deprecated.py:25:4: function '_directives_deprecated_library.norwegian_blue' is deprecated: It is pining for the fjords [deprecated] +./directives_deprecated.py:30:0: Use of deprecated overload (x: int) -> str: Only str will be allowed [deprecated] +./directives_deprecated.py:41:4: function '_directives_deprecated_library.Spam.__add__' with typevars TypeVarMap(typevars={~SelfT@_directives_deprecated_library.Spam=_directives_deprecated_library.Spam}) is deprecated: There is enough spam in the world [deprecated] +./directives_deprecated.py:42:0: function '_directives_deprecated_library.Spam.__add__' with typevars TypeVarMap(typevars={~SelfT@_directives_deprecated_library.Spam=_directives_deprecated_library.Spam}) is deprecated: There is enough spam in the world [deprecated] +./directives_deprecated.py:44:0: Property getter 'greasy' is deprecated: All spam will be equally greasy [deprecated] +./directives_deprecated.py:47:0: Property setter 'shape' is deprecated: Shapes are becoming immutable [deprecated] +./directives_deprecated.py:48:0: Property setter 'shape' is deprecated: Shapes are becoming immutable [deprecated] +./directives_deprecated.py:58:0: Method __call__ is deprecated: Deprecated [deprecated] +./directives_deprecated.py:69:0: () -> None is deprecated: Deprecated [deprecated] +./directives_deprecated.py:98:4: () -> None is deprecated: Deprecated [deprecated] +""" diff --git a/conformance/results/pycroscope/directives_disjoint_base.toml b/conformance/results/pycroscope/directives_disjoint_base.toml new file mode 100644 index 00000000..96a30b84 --- /dev/null +++ b/conformance/results/pycroscope/directives_disjoint_base.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not reject invalid class definitions due to disjoint bases, but uses disjoint base information in type narrowing. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 69: Expected 1 errors +Line 73: Expected 1 errors +Line 77: Expected 1 errors +Line 81: Expected 1 errors +Line 105: Expected 1 errors +Line 118: Expected 1 errors +Line 123: Expected 1 errors +""" +output = """ +./directives_disjoint_base.py:113:1: Incompatible argument type for cls: expected ~_TC but got () -> None [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/directives_no_type_check.toml b/conformance/results/pycroscope/directives_no_type_check.toml new file mode 100644 index 00000000..869c5989 --- /dev/null +++ b/conformance/results/pycroscope/directives_no_type_check.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./directives_no_type_check.py:15:4: Incompatible assignment: expected int, got Literal[''] [incompatible_assignment] +./directives_no_type_check.py:25:8: Unsupported operands for addition: int and str [unsupported_operation] +./directives_no_type_check.py:26:4: Incompatible return type: expected None, got Literal[1] [incompatible_return_value] +./directives_no_type_check.py:29:6: Incompatible argument type for a: expected int but got Literal[b'invalid'] [incompatible_argument] +./directives_no_type_check.py:29:18: Incompatible argument type for b: expected str but got Literal[b'arguments'] [incompatible_argument] +./directives_no_type_check.py:32:0: Missing required argument 'a' [incompatible_call] +""" diff --git a/conformance/results/pycroscope/directives_reveal_type.toml b/conformance/results/pycroscope/directives_reveal_type.toml new file mode 100644 index 00000000..4af147aa --- /dev/null +++ b/conformance/results/pycroscope/directives_reveal_type.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./directives_reveal_type.py:14:16: Revealed type is 'int | str' [reveal_type] +./directives_reveal_type.py:15:16: Revealed type is 'list[int]' [reveal_type] +./directives_reveal_type.py:16:16: Revealed type is 'Any[explicit]' [reveal_type] +./directives_reveal_type.py:17:16: Revealed type is 'directives_reveal_type.ForwardReference' [reveal_type] +./directives_reveal_type.py:19:4: In call to typing.reveal_type: Missing required positional argument 'value' [incompatible_call] +./directives_reveal_type.py:20:4: In call to typing.reveal_type: Takes 1 positional arguments but 2 were given [incompatible_call] +""" diff --git a/conformance/results/pycroscope/directives_type_checking.toml b/conformance/results/pycroscope/directives_type_checking.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/directives_type_checking.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/directives_type_ignore.toml b/conformance/results/pycroscope/directives_type_ignore.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/directives_type_ignore.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/directives_type_ignore_file1.toml b/conformance/results/pycroscope/directives_type_ignore_file1.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/directives_type_ignore_file1.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/directives_type_ignore_file2.toml b/conformance/results/pycroscope/directives_type_ignore_file2.toml new file mode 100644 index 00000000..b1f55aca --- /dev/null +++ b/conformance/results/pycroscope/directives_type_ignore_file2.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./directives_type_ignore_file2.py:14:0: Incompatible assignment: expected int, got Literal[''] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/directives_version_platform.toml b/conformance/results/pycroscope/directives_version_platform.toml new file mode 100644 index 00000000..a6ce7215 --- /dev/null +++ b/conformance/results/pycroscope/directives_version_platform.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./directives_version_platform.py:33:18: Undefined name: val3 [undefined_name] +./directives_version_platform.py:50:18: Undefined name: val6 [undefined_name] +./directives_version_platform.py:59:18: Undefined name: val9 [undefined_name] +./directives_version_platform.py:66:18: val10 may be used uninitialized [possibly_undefined_name] +./directives_version_platform.py:67:21: val11 may be used uninitialized [possibly_undefined_name] +./directives_version_platform.py:74:21: val12 may be used uninitialized [possibly_undefined_name] +./directives_version_platform.py:75:18: val13 may be used uninitialized [possibly_undefined_name] +""" diff --git a/conformance/results/pycroscope/enums_behaviors.toml b/conformance/results/pycroscope/enums_behaviors.toml new file mode 100644 index 00000000..abe03044 --- /dev/null +++ b/conformance/results/pycroscope/enums_behaviors.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./enums_behaviors.py:28:12: ./enums_behaviors.py.Color is not equivalent to Literal[] +./enums_behaviors.py:32:12: ./enums_behaviors.py.Color is not equivalent to Literal[] +./enums_behaviors.py:44:20: Cannot inherit from final class [invalid_base] +""" diff --git a/conformance/results/pycroscope/enums_definition.toml b/conformance/results/pycroscope/enums_definition.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/enums_definition.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/enums_expansion.toml b/conformance/results/pycroscope/enums_expansion.toml new file mode 100644 index 00000000..e12a9c12 --- /dev/null +++ b/conformance/results/pycroscope/enums_expansion.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./enums_expansion.py:53:20: enums_expansion.CustomFlags is not equivalent to Literal[] +""" diff --git a/conformance/results/pycroscope/enums_member_names.toml b/conformance/results/pycroscope/enums_member_names.toml new file mode 100644 index 00000000..3a96dcaf --- /dev/null +++ b/conformance/results/pycroscope/enums_member_names.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./enums_member_names.py:21:12: str is not equivalent to Literal['RED'] +./enums_member_names.py:30:16: Annotated[str, EnumName(enum_cls=)] is not equivalent to Literal['RED', 'BLUE', 'GREEN'] +""" diff --git a/conformance/results/pycroscope/enums_member_values.toml b/conformance/results/pycroscope/enums_member_values.toml new file mode 100644 index 00000000..ca9b47ee --- /dev/null +++ b/conformance/results/pycroscope/enums_member_values.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./enums_member_values.py:21:12: Any[explicit] is not equivalent to Literal[1] +./enums_member_values.py:54:12: Literal[(1, 3.303e+23, 2439700.0)] is not equivalent to Literal[1] +./enums_member_values.py:68:12: Literal[] is not equivalent to Literal[1] +./enums_member_values.py:78:4: Enum member value must be assignable to int [invalid_annotation] +./enums_member_values.py:85:8: Enum member value must be assignable to str [invalid_annotation] +./enums_member_values.py:96:12: Literal[Ellipsis] is not equivalent to int +""" diff --git a/conformance/results/pycroscope/enums_members.toml b/conformance/results/pycroscope/enums_members.toml new file mode 100644 index 00000000..a7edb501 --- /dev/null +++ b/conformance/results/pycroscope/enums_members.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./enums_members.py:54:4: Enum members should not be explicitly annotated [invalid_annotation] +./enums_members.py:86:11: Arguments to Literal[] must be literals, not (AnyValue(source=),) [invalid_literal] +./enums_members.py:87:11: Arguments to Literal[] must be literals, not (CallableValue(typ=, literal_only=False, signature=Signature(parameters={'x': SigParameter(name='x', kind=, default=None, annotation=TypedValue(typ=, literal_only=False))}, return_value=TypedValue(typ=, literal_only=False), impl=None, callable=None, is_asynq=False, has_return_annotation=True, allow_call=False, allow_partial_call=False, evaluator=None, deprecated=None)),) [invalid_literal] +./enums_members.py:88:9: Arguments to Literal[] must be literals, not (TypedValue(typ=, literal_only=False),) [invalid_literal] +./enums_members.py:89:7: Arguments to Literal[] must be literals, not (CallableValue(typ=, literal_only=False, signature=Signature(parameters={'self': SigParameter(name='self', kind=, default=None, annotation=TypedValue(typ=ClassOwner(module='./enums_members.py', qualname='Pet4', identity='./enums_members.py.Pet4'), literal_only=False))}, return_value=KnownValue(val=None), impl=None, callable=None, is_asynq=False, has_return_annotation=True, allow_call=False, allow_partial_call=False, evaluator=None, deprecated=None)),) [invalid_literal] +./enums_members.py:120:12: int is not equivalent to Any[unannotated] +./enums_members.py:132:20: Revealed type is 'int' [reveal_type] +./enums_members.py:133:20: int is not equivalent to Any[unannotated] +./enums_members.py:150:12: ./enums_members.py.Pet5 is not equivalent to int +./enums_members.py:151:12: ./enums_members.py.Pet5 is not equivalent to int +""" diff --git a/conformance/results/pycroscope/exceptions_context_managers.toml b/conformance/results/pycroscope/exceptions_context_managers.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/exceptions_context_managers.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/generics_base_class.toml b/conformance/results/pycroscope/generics_base_class.toml new file mode 100644 index 00000000..4f03dbec --- /dev/null +++ b/conformance/results/pycroscope/generics_base_class.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_base_class.py:26:25: Incompatible argument type for x: expected dict[str, list[object]] but got ./generics_base_class.py.SymbolTable [incompatible_argument] +./generics_base_class.py:29:10: Generic[...] is valid only as a base class [invalid_annotation] +./generics_base_class.py:30:7: Generic[...] is valid only as a base class [invalid_annotation] +./generics_base_class.py:49:21: Expected 1 type arguments for ./generics_base_class.py.LinkedList [invalid_specialization] +./generics_base_class.py:61:17: Expected 1 type arguments for ./generics_base_class.py.MyDict [invalid_specialization] +./generics_base_class.py:68:24: Type parameter list cannot contain duplicate type variables [invalid_base] +./generics_base_class.py:98:31: Inconsistent type variable order in base classes [invalid_base] +""" diff --git a/conformance/results/pycroscope/generics_basic.toml b/conformance/results/pycroscope/generics_basic.toml new file mode 100644 index 00000000..1876b101 --- /dev/null +++ b/conformance/results/pycroscope/generics_basic.toml @@ -0,0 +1,18 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_basic.py:40:4: Cannot resolve type variables [incompatible_call] +./generics_basic.py:41:4: Cannot resolve type variables [incompatible_call] +./generics_basic.py:49:17: TypeVar must have at least two constraints [incompatible_call] +./generics_basic.py:55:52: TypeVar bounds and constraints cannot contain type parameters [invalid_annotation] +./generics_basic.py:69:4: Cannot resolve type variables [incompatible_call] +./generics_basic.py:121:20: Type parameter list cannot contain duplicate type variables [invalid_base] +./generics_basic.py:157:7: Incompatible argument type for key: expected str but got Literal[0] [incompatible_argument] +./generics_basic.py:158:7: Incompatible argument type for key: expected str but got Literal[0] [incompatible_argument] +./generics_basic.py:162:19: All arguments to Generic or Protocol must be type variables [invalid_base] +./generics_basic.py:163:20: All arguments to Generic or Protocol must be type variables [invalid_base] +./generics_basic.py:171:27: All type parameters for the class must appear within Generic or Protocol [invalid_base] +./generics_basic.py:172:27: All type parameters for the class must appear within Generic or Protocol [invalid_base] +./generics_basic.py:208:36: Cannot determine metaclass [invalid_metaclass] +""" diff --git a/conformance/results/pycroscope/generics_defaults.toml b/conformance/results/pycroscope/generics_defaults.toml new file mode 100644 index 00000000..93d9e5fb --- /dev/null +++ b/conformance/results/pycroscope/generics_defaults.toml @@ -0,0 +1,44 @@ +conformant = "Partial" +notes = """ +Numerous issues; does not support TypeVarTuple and ParamSpec defaults. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 33: Unexpected errors ['./generics_defaults.py:33:16: ~DefaultStrT@./generics_defaults.py.NoNonDefaults is not equivalent to str'] +Line 34: Unexpected errors ['./generics_defaults.py:34:16: ~DefaultIntT@./generics_defaults.py.NoNonDefaults is not equivalent to int'] +Line 73: Unexpected errors ['./generics_defaults.py:73:16: ~T1@./generics_defaults.py.AllTheDefaults is not equivalent to Any[explicit]'] +Line 74: Unexpected errors ['./generics_defaults.py:74:16: ~T2@./generics_defaults.py.AllTheDefaults is not equivalent to Any[explicit]'] +Line 75: Unexpected errors ['./generics_defaults.py:75:16: ~DefaultStrT@./generics_defaults.py.NoNonDefaults is not equivalent to str'] +Line 76: Unexpected errors ['./generics_defaults.py:76:16: ~DefaultIntT@./generics_defaults.py.NoNonDefaults is not equivalent to int'] +Line 77: Unexpected errors ['./generics_defaults.py:77:16: ~DefaultBoolT@./generics_defaults.py.AllTheDefaults is not equivalent to bool'] +Line 122: Unexpected errors ['./generics_defaults.py:122:16: (**__P: **DefaultP@./generics_defaults.py.Class_ParamSpec) -> None is not equivalent to (str, int, /) -> None'] +Line 124: Unexpected errors ['./generics_defaults.py:124:16: ./generics_defaults.py.Class_ParamSpec[AnySig()] is not equivalent to ./generics_defaults.py.Class_ParamSpec[tuple[bool, bool]]'] +Line 144: Unexpected errors ['./generics_defaults.py:144:60: Incompatible argument type for default: expected TypeForm[object] but got Literal[typing.Unpack[DefaultTs]] [incompatible_argument]'] +Line 203: Unexpected errors ["./generics_defaults.py:203:36: Invalid type annotation [] [invalid_annotation]", './generics_defaults.py:203:17: ParamSpec specialization must use list form, Concatenate[..., P], P, or ... [invalid_annotation]'] +Line 204: Unexpected errors ['./generics_defaults.py:204:16: tuple[int] is not equivalent to tuple[int, str]'] +Line 205: Unexpected errors ['./generics_defaults.py:205:16: (...) -> None is not equivalent to (float | int, bool, /) -> None'] +Line 208: Unexpected errors ['./generics_defaults.py:208:16: (...) -> None is not equivalent to (bytes, /) -> None'] +""" +output = """ +./generics_defaults.py:24:0: non-default TypeVars cannot follow ones with defaults [invalid_type_parameter] +./generics_defaults.py:33:16: ~DefaultStrT@./generics_defaults.py.NoNonDefaults is not equivalent to str +./generics_defaults.py:34:16: ~DefaultIntT@./generics_defaults.py.NoNonDefaults is not equivalent to int +./generics_defaults.py:66:7: Expected at least 2 type arguments for ./generics_defaults.py.AllTheDefaults [invalid_specialization] +./generics_defaults.py:73:16: ~T1@./generics_defaults.py.AllTheDefaults is not equivalent to Any[explicit] +./generics_defaults.py:74:16: ~T2@./generics_defaults.py.AllTheDefaults is not equivalent to Any[explicit] +./generics_defaults.py:75:16: ~DefaultStrT@./generics_defaults.py.NoNonDefaults is not equivalent to str +./generics_defaults.py:76:16: ~DefaultIntT@./generics_defaults.py.NoNonDefaults is not equivalent to int +./generics_defaults.py:77:16: ~DefaultBoolT@./generics_defaults.py.AllTheDefaults is not equivalent to bool +./generics_defaults.py:122:16: (**__P: **DefaultP@./generics_defaults.py.Class_ParamSpec) -> None is not equivalent to (str, int, /) -> None +./generics_defaults.py:124:16: ./generics_defaults.py.Class_ParamSpec[AnySig()] is not equivalent to ./generics_defaults.py.Class_ParamSpec[tuple[bool, bool]] +./generics_defaults.py:144:60: Incompatible argument type for default: expected TypeForm[object] but got Literal[typing.Unpack[DefaultTs]] [incompatible_argument] +./generics_defaults.py:152:50: TypeVar default must be assignable to its bound [incompatible_call] +./generics_defaults.py:159:51: TypeVar default must be one of its constraints [incompatible_call] +./generics_defaults.py:176:12: Any[generic_argument] is not equivalent to int +./generics_defaults.py:188:0: TypeVars with defaults cannot follow TypeVarTuples [invalid_type_parameter] +./generics_defaults.py:203:36: Invalid type annotation [] [invalid_annotation] +./generics_defaults.py:203:17: ParamSpec specialization must use list form, Concatenate[..., P], P, or ... [invalid_annotation] +./generics_defaults.py:204:16: tuple[int] is not equivalent to tuple[int, str] +./generics_defaults.py:205:16: (...) -> None is not equivalent to (float | int, bool, /) -> None +./generics_defaults.py:208:16: (...) -> None is not equivalent to (bytes, /) -> None +""" diff --git a/conformance/results/pycroscope/generics_defaults_referential.toml b/conformance/results/pycroscope/generics_defaults_referential.toml new file mode 100644 index 00000000..bd7f61ce --- /dev/null +++ b/conformance/results/pycroscope/generics_defaults_referential.toml @@ -0,0 +1,22 @@ +conformant = "Partial" +notes = """ +Fails to apply default specializations in some cases. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 23: Unexpected errors ["./generics_defaults_referential.py:23:12: type 'generics_defaults_referential.slice' is not equivalent to type[generics_defaults_referential.slice[int, int, int | None]]"] +Line 98: Unexpected errors ['./generics_defaults_referential.py:98:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit]'] +Line 99: Unexpected errors ['./generics_defaults_referential.py:99:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]]'] +""" +output = """ +./generics_defaults_referential.py:23:12: type 'generics_defaults_referential.slice' is not equivalent to type[generics_defaults_referential.slice[int, int, int | None]] +./generics_defaults_referential.py:37:16: Incompatible argument type for b: expected int but got str [incompatible_argument] +./generics_defaults_referential.py:38:13: Incompatible argument type for a: expected int but got str [incompatible_argument] +./generics_defaults_referential.py:54:0: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter] +./generics_defaults_referential.py:61:4: Type parameter defaults can reference only earlier type parameters from the same class [invalid_type_parameter] +./generics_defaults_referential.py:69:39: TypeVar default must be assignable to its bound [incompatible_call] +./generics_defaults_referential.py:75:51: TypeVar default must be one of its constraints [incompatible_call] +./generics_defaults_referential.py:79:62: TypeVar default must be one of its constraints [incompatible_call] +./generics_defaults_referential.py:98:16: ~Z1@generics_defaults_referential.Bar is not equivalent to Any[explicit] +./generics_defaults_referential.py:99:16: ~ListDefaultT@generics_defaults_referential.Bar is not equivalent to list[Any[explicit]] +""" diff --git a/conformance/results/pycroscope/generics_defaults_specialization.toml b/conformance/results/pycroscope/generics_defaults_specialization.toml new file mode 100644 index 00000000..aab3a627 --- /dev/null +++ b/conformance/results/pycroscope/generics_defaults_specialization.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_defaults_specialization.py:30:0: Expected 1 type arguments for type alias, got 2 [invalid_specialization] +./generics_defaults_specialization.py:46:0: Incompatible assignment: expected type[./generics_defaults_specialization.py.Bar[int]], got [incompatible_assignment] +./generics_defaults_specialization.py:56:0: ./generics_defaults_specialization.py.Foo cannot be further subscripted [invalid_specialization] +""" diff --git a/conformance/results/pycroscope/generics_paramspec_basic.toml b/conformance/results/pycroscope/generics_paramspec_basic.toml new file mode 100644 index 00000000..5a5c534f --- /dev/null +++ b/conformance/results/pycroscope/generics_paramspec_basic.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_paramspec_basic.py:10:22: ParamSpec named 'NotIt' must be assigned to a variable with the same name [must_have_same_name] +./generics_paramspec_basic.py:15:17: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_basic.py:23:10: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_basic.py:23:19: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_basic.py:27:13: Unrecognized annotation typing.Concatenate[, ~P] [invalid_annotation] +./generics_paramspec_basic.py:31:10: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_basic.py:35:10: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_basic.py:39:11: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_basic.py:39:22: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +""" diff --git a/conformance/results/pycroscope/generics_paramspec_components.toml b/conformance/results/pycroscope/generics_paramspec_components.toml new file mode 100644 index 00000000..80e8cbcc --- /dev/null +++ b/conformance/results/pycroscope/generics_paramspec_components.toml @@ -0,0 +1,23 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_paramspec_components.py:17:18: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_components.py:17:36: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_components.py:20:19: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_components.py:23:37: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_components.py:26:37: ParamSpec.args must be used together with ParamSpec.kwargs [invalid_paramspec_usage] +./generics_paramspec_components.py:30:18: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_components.py:30:34: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_components.py:35:17: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_components.py:36:19: ParamSpec cannot be used in this annotation context [invalid_paramspec_usage] +./generics_paramspec_components.py:38:19: ParamSpec.args must be used together with ParamSpec.kwargs [invalid_paramspec_usage] +./generics_paramspec_components.py:41:22: ParamSpec.kwargs must be used together with ParamSpec.args [invalid_paramspec_usage] +./generics_paramspec_components.py:49:8: tuple[object, ...] is not a mapping [incompatible_call] +./generics_paramspec_components.py:51:8: Takes 0 positional arguments but 1 were given [incompatible_call] +./generics_paramspec_components.py:60:37: ParamSpec.args and ParamSpec.kwargs must be adjacent [invalid_paramspec_usage] +./generics_paramspec_components.py:70:17: Arguments cannot follow ParamSpec.args [incompatible_call] +./generics_paramspec_components.py:72:8: Missing required positional argument at position 0 [incompatible_call] +./generics_paramspec_components.py:83:14: Arguments cannot follow ParamSpec.args [incompatible_call] +./generics_paramspec_components.py:98:0: In call to generics_paramspec_components.twice: Cannot resolve type variables [incompatible_call] +""" diff --git a/conformance/results/pycroscope/generics_paramspec_semantics.toml b/conformance/results/pycroscope/generics_paramspec_semantics.toml new file mode 100644 index 00000000..dfaf3a3c --- /dev/null +++ b/conformance/results/pycroscope/generics_paramspec_semantics.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_paramspec_semantics.py:26:0: Missing required positional argument 'a' [incompatible_call] +./generics_paramspec_semantics.py:27:8: Incompatible argument type for b: expected bool but got Literal['A'] [incompatible_argument] +./generics_paramspec_semantics.py:46:5: Cannot resolve type variables [incompatible_call] +./generics_paramspec_semantics.py:61:0: Cannot resolve type variables [incompatible_call] +./generics_paramspec_semantics.py:98:3: Incompatible argument type for @0: expected str but got Literal[1] [incompatible_argument] +./generics_paramspec_semantics.py:108:0: Incompatible argument type for args: expected tuple[bool, ...] but got tuple[Literal[1]] [incompatible_argument] +./generics_paramspec_semantics.py:120:3: Incompatible argument type for @0: expected str but got Literal[1] [incompatible_argument] +./generics_paramspec_semantics.py:127:1: Incompatible argument type for x: expected (int, /, ****P@./generics_paramspec_semantics.py.expects_int_first..expects_int_first) -> int but got (x: str) -> int [incompatible_argument] +./generics_paramspec_semantics.py:132:1: Incompatible argument type for x: expected (int, /, ****P@./generics_paramspec_semantics.py.expects_int_first..expects_int_first) -> int but got (*, x: int) -> int [incompatible_argument] +./generics_paramspec_semantics.py:137:1: Incompatible argument type for x: expected (int, /, ****P@./generics_paramspec_semantics.py.expects_int_first..expects_int_first) -> int but got (**kwargs: dict[str, int]) -> int [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/generics_paramspec_specialization.toml b/conformance/results/pycroscope/generics_paramspec_specialization.toml new file mode 100644 index 00000000..5dd4d8c8 --- /dev/null +++ b/conformance/results/pycroscope/generics_paramspec_specialization.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_paramspec_specialization.py:44:14: ParamSpec specialization must use list form, Concatenate[..., P], P, or ... [invalid_annotation] +./generics_paramspec_specialization.py:54:8: Incompatible argument type for @0: expected int but got Literal[''] [incompatible_argument] +./generics_paramspec_specialization.py:55:15: Incompatible argument type for @2: expected bool but got Literal[''] [incompatible_argument] +./generics_paramspec_specialization.py:60:8: Incompatible argument type for @0: expected int but got Literal[''] [incompatible_argument] +./generics_paramspec_specialization.py:61:15: Incompatible argument type for @2: expected bool but got Literal[''] [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/generics_scoping.toml b/conformance/results/pycroscope/generics_scoping.toml new file mode 100644 index 00000000..3238868e --- /dev/null +++ b/conformance/results/pycroscope/generics_scoping.toml @@ -0,0 +1,19 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_scoping.py:15:12: Literal[1] is not equivalent to int +./generics_scoping.py:19:12: Literal['a'] is not equivalent to str +./generics_scoping.py:34:9: Incompatible argument type for x: expected int but got Literal['a'] [incompatible_argument] +./generics_scoping.py:49:12: Literal['abc'] is not equivalent to str +./generics_scoping.py:53:12: Literal[b'abc'] is not equivalent to bytes +./generics_scoping.py:61:12: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_scoping.py:65:18: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_scoping.py:76:28: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_scoping.py:86:23: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_scoping.py:89:16: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_scoping.py:98:28: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_scoping.py:105:13: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_scoping.py:106:18: Type parameter is not valid in this annotation context [invalid_annotation] +./generics_scoping.py:107:5: Type parameter is not valid in this annotation context [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/generics_self_advanced.toml b/conformance/results/pycroscope/generics_self_advanced.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/generics_self_advanced.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/generics_self_attributes.toml b/conformance/results/pycroscope/generics_self_attributes.toml new file mode 100644 index 00000000..c49b0428 --- /dev/null +++ b/conformance/results/pycroscope/generics_self_attributes.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_self_attributes.py:26:37: Incompatible argument type for next: expected generics_self_attributes.OrdinalLinkedList | None but got generics_self_attributes.LinkedList[int] [incompatible_argument] +./generics_self_attributes.py:32:4: Incompatible types in assignment to attribute 'next': expected generics_self_attributes.OrdinalLinkedList | None, got generics_self_attributes.LinkedList[int] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/generics_self_basic.toml b/conformance/results/pycroscope/generics_self_basic.toml new file mode 100644 index 00000000..d93d9f37 --- /dev/null +++ b/conformance/results/pycroscope/generics_self_basic.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_self_basic.py:20:8: Incompatible return type: expected ~SelfT@./generics_self_basic.py.Shape, got ./generics_self_basic.py.Shape [incompatible_return_value] +./generics_self_basic.py:33:8: Incompatible return type: expected ~SelfT@./generics_self_basic.py.Shape, got ./generics_self_basic.py.Shape [incompatible_return_value] +./generics_self_basic.py:68:25: Self cannot be further subscripted [invalid_specialization] +""" diff --git a/conformance/results/pycroscope/generics_self_protocols.toml b/conformance/results/pycroscope/generics_self_protocols.toml new file mode 100644 index 00000000..cfcf2f65 --- /dev/null +++ b/conformance/results/pycroscope/generics_self_protocols.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_self_protocols.py:61:18: Incompatible argument type for shape: expected generics_self_protocols.ShapeProtocol but got generics_self_protocols.BadReturnType [incompatible_argument] +./generics_self_protocols.py:64:18: Incompatible argument type for shape: expected generics_self_protocols.ShapeProtocol but got generics_self_protocols.ReturnDifferentClass [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/generics_self_usage.toml b/conformance/results/pycroscope/generics_self_usage.toml new file mode 100644 index 00000000..b3b83f3d --- /dev/null +++ b/conformance/results/pycroscope/generics_self_usage.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_self_usage.py:73:13: Self cannot be used outside a class [invalid_self_usage] +./generics_self_usage.py:73:22: Self cannot be used outside a class [invalid_self_usage] +./generics_self_usage.py:76:5: Self can only be used in class attribute annotations [invalid_self_usage] +./generics_self_usage.py:82:4: Self methods using Self must annotate the receiver with Self or leave it unannotated [invalid_self_usage] +./generics_self_usage.py:87:8: Incompatible return type: expected ~SelfT@./generics_self_usage.py.Foo3, got ./generics_self_usage.py.Foo3 [incompatible_return_value] +./generics_self_usage.py:103:10: Self cannot be used in base class expressions [invalid_base] +./generics_self_usage.py:105:11: Self cannot be used in base class expressions [invalid_base] +./generics_self_usage.py:108:23: Self cannot be used in type aliases [invalid_self_usage] +./generics_self_usage.py:113:4: Self cannot be used in staticmethod signatures [invalid_self_usage] +./generics_self_usage.py:118:4: Self cannot be used in staticmethod signatures [invalid_self_usage] +./generics_self_usage.py:123:4: Self cannot be used in metaclass definitions [invalid_self_usage] +./generics_self_usage.py:127:4: Self cannot be used in metaclass definitions [invalid_self_usage] +""" diff --git a/conformance/results/pycroscope/generics_syntax_compatibility.toml b/conformance/results/pycroscope/generics_syntax_compatibility.toml new file mode 100644 index 00000000..d4f3d517 --- /dev/null +++ b/conformance/results/pycroscope/generics_syntax_compatibility.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_syntax_compatibility.py:14:21: Class definition cannot combine old-style TypeVar declarations with type parameter syntax [invalid_annotation] +./generics_syntax_compatibility.py:26:34: Function definition cannot combine old-style TypeVar declarations with type parameter syntax [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/generics_syntax_declarations.toml b/conformance/results/pycroscope/generics_syntax_declarations.toml new file mode 100644 index 00000000..663c7959 --- /dev/null +++ b/conformance/results/pycroscope/generics_syntax_declarations.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_syntax_declarations.py:17:16: Class definition cannot specialize Generic or Protocol bases when using type parameter syntax [invalid_base] +./generics_syntax_declarations.py:25:19: Class definition cannot specialize Generic or Protocol bases when using type parameter syntax [invalid_base] +./generics_syntax_declarations.py:32:8: str has no attribute 'is_integer' [undefined_attribute] +./generics_syntax_declarations.py:44:20: TypeVar bound cannot be parameterized by type variables [invalid_annotation] +./generics_syntax_declarations.py:48:16: Invalid type annotation [, ] [invalid_annotation] +./generics_syntax_declarations.py:60:16: TypeVar constraints must contain at least two types [invalid_annotation] +./generics_syntax_declarations.py:64:16: TypeVar constraints must contain at least two types [invalid_annotation] +./generics_syntax_declarations.py:71:16: Invalid type annotation (, ) [invalid_annotation] +./generics_syntax_declarations.py:75:17: Invalid type annotation 3 [invalid_annotation] +./generics_syntax_declarations.py:79:22: Undefined name: S [undefined_name] +""" diff --git a/conformance/results/pycroscope/generics_syntax_infer_variance.toml b/conformance/results/pycroscope/generics_syntax_infer_variance.toml new file mode 100644 index 00000000..fdae01c6 --- /dev/null +++ b/conformance/results/pycroscope/generics_syntax_infer_variance.toml @@ -0,0 +1,23 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_syntax_infer_variance.py:15:5: TypeVar cannot combine infer_variance with explicit variance [incompatible_call] +./generics_syntax_infer_variance.py:17:5: TypeVar cannot combine infer_variance with explicit variance [incompatible_call] +./generics_syntax_infer_variance.py:29:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeCovariant1[int], got ./generics_syntax_infer_variance.py.ShouldBeCovariant1[float | int] [incompatible_assignment] +./generics_syntax_infer_variance.py:47:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeCovariant2[int], got ./generics_syntax_infer_variance.py.ShouldBeCovariant2[float | int] [incompatible_assignment] +./generics_syntax_infer_variance.py:56:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeCovariant3[int], got ./generics_syntax_infer_variance.py.ShouldBeCovariant3[float | int] [incompatible_assignment] +./generics_syntax_infer_variance.py:85:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeCovariant5[int], got ./generics_syntax_infer_variance.py.ShouldBeCovariant5[float | int] [incompatible_assignment] +./generics_syntax_infer_variance.py:96:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeCovariant6[int], got ./generics_syntax_infer_variance.py.ShouldBeCovariant6[float | int] [incompatible_assignment] +./generics_syntax_infer_variance.py:112:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant1[float | int], got ./generics_syntax_infer_variance.py.ShouldBeInvariant1[int] [incompatible_assignment] +./generics_syntax_infer_variance.py:113:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant1[int], got ./generics_syntax_infer_variance.py.ShouldBeInvariant1[float | int] [incompatible_assignment] +./generics_syntax_infer_variance.py:127:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant2[float | int], got ./generics_syntax_infer_variance.py.ShouldBeInvariant2[int] [incompatible_assignment] +./generics_syntax_infer_variance.py:128:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant2[int], got ./generics_syntax_infer_variance.py.ShouldBeInvariant2[float | int] [incompatible_assignment] +./generics_syntax_infer_variance.py:135:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant3[float | int, str], got ./generics_syntax_infer_variance.py.ShouldBeInvariant3[int, str] [incompatible_assignment] +./generics_syntax_infer_variance.py:136:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant3[int, str], got ./generics_syntax_infer_variance.py.ShouldBeInvariant3[float | int, str] [incompatible_assignment] +./generics_syntax_infer_variance.py:137:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant3[str, float | int], got ./generics_syntax_infer_variance.py.ShouldBeInvariant3[str, int] [incompatible_assignment] +./generics_syntax_infer_variance.py:138:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant3[str, int], got ./generics_syntax_infer_variance.py.ShouldBeInvariant3[str, float | int] [incompatible_assignment] +./generics_syntax_infer_variance.py:146:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant4[float | int], got ./generics_syntax_infer_variance.py.ShouldBeInvariant4[int] [incompatible_assignment] +./generics_syntax_infer_variance.py:154:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeInvariant5[float | int], got ./generics_syntax_infer_variance.py.ShouldBeInvariant5[int] [incompatible_assignment] +./generics_syntax_infer_variance.py:165:0: Incompatible assignment: expected ./generics_syntax_infer_variance.py.ShouldBeContravariant1[float | int], got ./generics_syntax_infer_variance.py.ShouldBeContravariant1[int] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/generics_syntax_scoping.toml b/conformance/results/pycroscope/generics_syntax_scoping.toml new file mode 100644 index 00000000..3bff89f0 --- /dev/null +++ b/conformance/results/pycroscope/generics_syntax_scoping.toml @@ -0,0 +1,24 @@ +conformant = "Partial" +notes = """ +Misses some details of scoping rules. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 18: Expected 1 errors +Line 92: Expected 1 errors +Line 95: Expected 1 errors +Line 98: Expected 1 errors +Line 74: Unexpected errors ['./generics_syntax_scoping.py:74:19: Undefined name: Private [undefined_name]'] +Line 88: Unexpected errors ['./generics_syntax_scoping.py:88:1: Undefined name: decorator2 [undefined_name]'] +Line 117: Unexpected errors ['./generics_syntax_scoping.py:117:28: ~T@./generics_syntax_scoping.py.f..Outer2 is not equivalent to typing.TypeVar', './generics_syntax_scoping.py:117:28: Type parameter is not valid in this annotation context [invalid_annotation]'] +""" +output = """ +./generics_syntax_scoping.py:14:19: TypeVar bound cannot be parameterized by type variables [invalid_annotation] +./generics_syntax_scoping.py:35:6: Undefined name: T [undefined_name] +./generics_syntax_scoping.py:44:16: Undefined name: T [undefined_name] +./generics_syntax_scoping.py:44:1: Undefined name: decorator1 [undefined_name] +./generics_syntax_scoping.py:74:19: Undefined name: Private [undefined_name] +./generics_syntax_scoping.py:88:1: Undefined name: decorator2 [undefined_name] +./generics_syntax_scoping.py:117:28: ~T@./generics_syntax_scoping.py.f..Outer2 is not equivalent to typing.TypeVar +./generics_syntax_scoping.py:117:28: Type parameter is not valid in this annotation context [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/generics_type_erasure.toml b/conformance/results/pycroscope/generics_type_erasure.toml new file mode 100644 index 00000000..9ffdc5c1 --- /dev/null +++ b/conformance/results/pycroscope/generics_type_erasure.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_type_erasure.py:38:15: Incompatible argument type for label: expected int | None but got Literal[''] [incompatible_argument] +./generics_type_erasure.py:40:15: Incompatible argument type for label: expected str | None but got Literal[0] [incompatible_argument] +./generics_type_erasure.py:42:0: Cannot assign to instance attribute 'label' via class object [incompatible_assignment] +./generics_type_erasure.py:43:0: types.GenericAlias (partial from [type 'int']) has no attribute 'label' [undefined_attribute] +./generics_type_erasure.py:44:0: Cannot assign to instance attribute 'label' via class object [incompatible_assignment] +./generics_type_erasure.py:45:0: has no attribute 'label' [undefined_attribute] +./generics_type_erasure.py:46:0: type[./generics_type_erasure.py.Node[int]] has no attribute 'label' [undefined_attribute] +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_args.toml b/conformance/results/pycroscope/generics_typevartuple_args.toml new file mode 100644 index 00000000..e6581358 --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_args.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_typevartuple_args.py:33:4: Incompatible argument type for args: expected tuple[*tuple[Ts, ...], generics_typevartuple_args.Env] but got tuple[Literal[0], Literal['']] [incompatible_argument] +./generics_typevartuple_args.py:34:4: Incompatible argument type for args: expected tuple[*tuple[Ts, ...], generics_typevartuple_args.Env] but got tuple[Literal[0], Literal['']] [incompatible_argument] +./generics_typevartuple_args.py:48:0: Incompatible argument type for args: expected tuple[int, ...] but got tuple[Literal[1], Literal['2'], Literal[3]] [incompatible_argument] +./generics_typevartuple_args.py:57:0: Incompatible argument type for args: expected tuple[int, *tuple[str, ...], str] but got tuple[Literal[1], Literal[1], Literal['']] [incompatible_argument] +./generics_typevartuple_args.py:58:0: Incompatible argument type for args: expected tuple[int, *tuple[str, ...], str] but got tuple[Literal[1]] [incompatible_argument] +./generics_typevartuple_args.py:59:0: Incompatible argument type for args: expected tuple[int, *tuple[str, ...], str] but got tuple[Literal['']] [incompatible_argument] +./generics_typevartuple_args.py:67:0: In call to generics_typevartuple_args.func3: Missing required positional argument at position 1 [incompatible_call] +./generics_typevartuple_args.py:75:0: In call to generics_typevartuple_args.func4: Cannot resolve type variables [incompatible_call] +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_basic.toml b/conformance/results/pycroscope/generics_typevartuple_basic.toml new file mode 100644 index 00000000..842c7ca4 --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_basic.toml @@ -0,0 +1,19 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_typevartuple_basic.py:42:33: Incompatible argument type for shape: expected tuple[*tuple[Shape, ...]] but got NewType('Height', int) [incompatible_argument] +./generics_typevartuple_basic.py:43:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Batch', int), NewType('Width', int)] [incompatible_assignment] +./generics_typevartuple_basic.py:44:0: Incompatible assignment: expected ./generics_typevartuple_basic.py.Array[NewType('Time', int), NewType('Batch', int), NewType('Height', int), NewType('Width', int)], got ./generics_typevartuple_basic.py.Array~[NewType('Time', int), NewType('Batch', int), NewType('Width', int), NewType('Height', int)] [incompatible_assignment] +./generics_typevartuple_basic.py:52:21: TypeVarTuple must be unpacked [invalid_base] +./generics_typevartuple_basic.py:53:30: TypeVarTuple must be unpacked [invalid_annotation] +./generics_typevartuple_basic.py:56:27: TypeVarTuple must be unpacked [invalid_annotation] +./generics_typevartuple_basic.py:59:17: TypeVarTuple must be unpacked [invalid_annotation] +./generics_typevartuple_basic.py:65:6: In call to typing.TypeVarTuple: Got an unexpected keyword argument 'covariant' [incompatible_call] +./generics_typevartuple_basic.py:66:6: In call to typing.TypeVarTuple: Takes 1 positional arguments but 3 were given [incompatible_call] +./generics_typevartuple_basic.py:67:6: In call to typing.TypeVarTuple: Got an unexpected keyword argument 'bound' [incompatible_call] +./generics_typevartuple_basic.py:91:0: Cannot resolve type variables [incompatible_call] +./generics_typevartuple_basic.py:100:4: Cannot resolve type variables [incompatible_call] +./generics_typevartuple_basic.py:101:4: Cannot resolve type variables [incompatible_call] +./generics_typevartuple_basic.py:107:21: Only one TypeVarTuple can be used in a type parameter list [invalid_base] +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_callable.toml b/conformance/results/pycroscope/generics_typevartuple_callable.toml new file mode 100644 index 00000000..cf4dd26c --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_callable.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_typevartuple_callable.py:26:0: Cannot resolve type variables [incompatible_call] +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_concat.toml b/conformance/results/pycroscope/generics_typevartuple_concat.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_concat.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_overloads.toml b/conformance/results/pycroscope/generics_typevartuple_overloads.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_overloads.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_specialization.toml b/conformance/results/pycroscope/generics_typevartuple_specialization.toml new file mode 100644 index 00000000..9de610e5 --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_specialization.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_typevartuple_specialization.py:109:0: Unpacked TypeVarTuple cannot specialize this type alias [invalid_annotation] +./generics_typevartuple_specialization.py:110:0: Unpacked TypeVarTuple cannot specialize this type alias [invalid_annotation] +./generics_typevartuple_specialization.py:121:6: Only one unbounded tuple can be used inside a tuple type [invalid_annotation] +./generics_typevartuple_specialization.py:122:6: Only one unbounded tuple can be used inside a tuple type [invalid_annotation] +./generics_typevartuple_specialization.py:127:4: Expected 3 type arguments for type alias, got 1 [invalid_specialization] +./generics_typevartuple_specialization.py:163:7: Unpacked TypeVarTuple cannot specialize this type alias [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/generics_typevartuple_unpack.toml b/conformance/results/pycroscope/generics_typevartuple_unpack.toml new file mode 100644 index 00000000..7c7e107e --- /dev/null +++ b/conformance/results/pycroscope/generics_typevartuple_unpack.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_typevartuple_unpack.py:30:27: Incompatible argument type for x: expected generics_typevartuple_unpack.Array[NewType('Batch', int), *tuple[Any[explicit], ...], NewType('Channels', int)] but got generics_typevartuple_unpack.Array[NewType('Batch', int)] [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/generics_upper_bound.toml b/conformance/results/pycroscope/generics_upper_bound.toml new file mode 100644 index 00000000..4cd6263e --- /dev/null +++ b/conformance/results/pycroscope/generics_upper_bound.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_upper_bound.py:24:37: TypeVar bounds and constraints cannot contain type parameters [invalid_annotation] +./generics_upper_bound.py:44:16: list[int] | set[int] is not equivalent to collections.abc.Collection[int] +./generics_upper_bound.py:52:7: Incompatible argument type for x: expected ~ST@./generics_upper_bound.py.longer..longer but got Literal[3] [incompatible_argument] +./generics_upper_bound.py:57:9: TypeVar cannot have both bound and constraints [incompatible_call] +""" diff --git a/conformance/results/pycroscope/generics_variance.toml b/conformance/results/pycroscope/generics_variance.toml new file mode 100644 index 00000000..a4eb7dca --- /dev/null +++ b/conformance/results/pycroscope/generics_variance.toml @@ -0,0 +1,18 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_variance.py:14:5: Bivariant types are not supported [incompatible_call] +./generics_variance.py:77:13: T_co has incompatible variance in base class [invalid_base] +./generics_variance.py:81:13: T_contra has incompatible variance in base class [invalid_base] +./generics_variance.py:93:16: T_contra has incompatible variance in base class [invalid_base] +./generics_variance.py:105:20: T_co has incompatible variance in base class [invalid_base] +./generics_variance.py:113:20: T_co has incompatible variance in base class [invalid_base] +./generics_variance.py:126:4: T_co has incompatible variance in base class [invalid_base] +./generics_variance.py:132:4: T_contra has incompatible variance in base class [invalid_base] +./generics_variance.py:142:4: T_co has incompatible variance in base class [invalid_base] +./generics_variance.py:163:25: T_contra has incompatible variance in base class [invalid_base] +./generics_variance.py:167:29: T_co has incompatible variance in base class [invalid_base] +./generics_variance.py:191:32: T_contra has incompatible variance in base class [invalid_base] +./generics_variance.py:196:4: T_co has incompatible variance in base class [invalid_base] +""" diff --git a/conformance/results/pycroscope/generics_variance_inference.toml b/conformance/results/pycroscope/generics_variance_inference.toml new file mode 100644 index 00000000..56b1fa57 --- /dev/null +++ b/conformance/results/pycroscope/generics_variance_inference.toml @@ -0,0 +1,28 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./generics_variance_inference.py:24:4: Incompatible assignment: expected generics_variance_inference.ClassA[int, int, int], got generics_variance_inference.ClassA[float | int, int, int] [incompatible_assignment] +./generics_variance_inference.py:25:4: Incompatible assignment: expected generics_variance_inference.ClassA[float | int, float | int, int], got generics_variance_inference.ClassA[float | int, int, int] [incompatible_assignment] +./generics_variance_inference.py:28:4: Incompatible assignment: expected generics_variance_inference.ClassA[int, int, int], got generics_variance_inference.ClassA[int, float | int, float | int] [incompatible_assignment] +./generics_variance_inference.py:41:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant1[int], got generics_variance_inference.ShouldBeCovariant1[float | int] [incompatible_assignment] +./generics_variance_inference.py:49:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant2[int], got generics_variance_inference.ShouldBeCovariant2[float | int] [incompatible_assignment] +./generics_variance_inference.py:58:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant3[int], got generics_variance_inference.ShouldBeCovariant3[float | int] [incompatible_assignment] +./generics_variance_inference.py:67:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant4[int], got generics_variance_inference.ShouldBeCovariant4[float | int] [incompatible_assignment] +./generics_variance_inference.py:80:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant5[int], got generics_variance_inference.ShouldBeCovariant5[float | int] [incompatible_assignment] +./generics_variance_inference.py:96:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant1[float | int], got generics_variance_inference.ShouldBeInvariant1[int] [incompatible_assignment] +./generics_variance_inference.py:97:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant1[int], got generics_variance_inference.ShouldBeInvariant1[float | int] [incompatible_assignment] +./generics_variance_inference.py:111:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant2[float | int], got generics_variance_inference.ShouldBeInvariant2[int] [incompatible_assignment] +./generics_variance_inference.py:112:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant2[int], got generics_variance_inference.ShouldBeInvariant2[float | int] [incompatible_assignment] +./generics_variance_inference.py:119:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant3[float | int, str], got generics_variance_inference.ShouldBeInvariant3[int, str] [incompatible_assignment] +./generics_variance_inference.py:120:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant3[int, str], got generics_variance_inference.ShouldBeInvariant3[float | int, str] [incompatible_assignment] +./generics_variance_inference.py:121:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant3[str, float | int], got generics_variance_inference.ShouldBeInvariant3[str, int] [incompatible_assignment] +./generics_variance_inference.py:122:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant3[str, int], got generics_variance_inference.ShouldBeInvariant3[str, float | int] [incompatible_assignment] +./generics_variance_inference.py:130:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant4[float | int], got generics_variance_inference.ShouldBeInvariant4[int] [incompatible_assignment] +./generics_variance_inference.py:138:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant5[float | int], got generics_variance_inference.ShouldBeInvariant5[int] [incompatible_assignment] +./generics_variance_inference.py:149:0: Incompatible assignment: expected generics_variance_inference.ShouldBeContravariant1[float | int], got generics_variance_inference.ShouldBeContravariant1[int] [incompatible_assignment] +./generics_variance_inference.py:169:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant6[int], got generics_variance_inference.ShouldBeInvariant6[float | int] [incompatible_assignment] +./generics_variance_inference.py:170:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant6[float | int], got generics_variance_inference.ShouldBeInvariant6[int] [incompatible_assignment] +./generics_variance_inference.py:181:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant6[int], got generics_variance_inference.ShouldBeCovariant6[float | int] [incompatible_assignment] +./generics_variance_inference.py:194:0: Incompatible assignment: expected generics_variance_inference.ShouldBeContravariant2[float | int], got generics_variance_inference.ShouldBeContravariant2[int] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/historical_positional.toml b/conformance/results/pycroscope/historical_positional.toml new file mode 100644 index 00000000..d8bfa937 --- /dev/null +++ b/conformance/results/pycroscope/historical_positional.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./historical_positional.py:18:0: Missing required positional argument '__x' [incompatible_call] +./historical_positional.py:26:15: Historical positional-only parameter may not follow a positional-or-keyword parameter [invalid_positional_only] +./historical_positional.py:54:25: Historical positional-only parameter may not follow a positional-or-keyword parameter [invalid_positional_only] +./historical_positional.py:59:0: Missing required positional argument '__x' [incompatible_call] +""" diff --git a/conformance/results/pycroscope/literals_interactions.toml b/conformance/results/pycroscope/literals_interactions.toml new file mode 100644 index 00000000..e13017ec --- /dev/null +++ b/conformance/results/pycroscope/literals_interactions.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./literals_interactions.py:14:4: Tuple index out of range: Literal[5] [incompatible_call] +./literals_interactions.py:15:4: Tuple index out of range: Literal[-5] [incompatible_call] +./literals_interactions.py:16:4: Tuple index out of range: Literal[4] [incompatible_call] +./literals_interactions.py:17:4: Tuple index out of range: Literal[-4] [incompatible_call] +""" diff --git a/conformance/results/pycroscope/literals_literalstring.toml b/conformance/results/pycroscope/literals_literalstring.toml new file mode 100644 index 00000000..742999f5 --- /dev/null +++ b/conformance/results/pycroscope/literals_literalstring.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./literals_literalstring.py:36:11: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got typing.LiteralString [invalid_literal] +./literals_literalstring.py:37:13: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got typing.LiteralString [invalid_literal] +./literals_literalstring.py:43:4: Incompatible assignment: expected Literal[''], got Literal['two'] [incompatible_assignment] +./literals_literalstring.py:65:4: Incompatible assignment: expected LiteralString, got str [incompatible_assignment] +./literals_literalstring.py:73:4: Incompatible assignment: expected LiteralString, got Literal[3] [incompatible_assignment] +./literals_literalstring.py:74:4: Incompatible assignment: expected LiteralString, got Literal[b'test'] [incompatible_assignment] +./literals_literalstring.py:119:21: Incompatible argument type for s: expected ~TLiteral but got str [incompatible_argument] +./literals_literalstring.py:133:50: Incompatible argument type for value: expected ~T@literals_literalstring.Container but got str [incompatible_argument] +./literals_literalstring.py:171:4: Incompatible assignment: expected list[str], got list[LiteralString] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/literals_parameterizations.toml b/conformance/results/pycroscope/literals_parameterizations.toml new file mode 100644 index 00000000..80a88342 --- /dev/null +++ b/conformance/results/pycroscope/literals_parameterizations.toml @@ -0,0 +1,27 @@ +conformant = "Partial" +notes = """ +Fails to reject various invalid literal parameterizations. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 44: Expected 1 errors +Line 45: Expected 1 errors +Line 46: Expected 1 errors +Line 49: Expected 1 errors +Line 56: Expected 1 errors +""" +output = """ +./literals_parameterizations.py:43:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got (4+3j) [invalid_literal] +./literals_parameterizations.py:47:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got {'a': 'b', 'c': 'd'} [invalid_literal] +./literals_parameterizations.py:48:6: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got [invalid_literal] +./literals_parameterizations.py:50:7: Arguments to Literal[] must be literals, not (PartialCallValue(callee=KnownValue(val=), arguments={'name': KnownValue(val='T'), 'constraints': SequenceValue(typ=, literal_only=False, args=(MultiValuedValue(vals=()),), weak=True, members=()), 'bound': KnownValue(val=), 'covariant': KnownValue(val=False), 'contravariant': KnownValue(val=False), 'infer_variance': KnownValue(val=False), 'default': KnownValue(val=)}, runtime_value=TypedValue(typ=, literal_only=False), node=),) [invalid_literal] +./literals_parameterizations.py:50:15: Type parameter is not valid in this annotation context [invalid_annotation] +./literals_parameterizations.py:51:7: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got 3.14 [invalid_literal] +./literals_parameterizations.py:52:7: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got typing.Any [invalid_literal] +./literals_parameterizations.py:53:7: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got Ellipsis [invalid_literal] +./literals_parameterizations.py:60:3: Invalid type annotation typing.Literal [invalid_annotation] +./literals_parameterizations.py:61:3: Arguments to Literal[] must be None, bool, int, str, bytes, or enum members; got [invalid_literal] +./literals_parameterizations.py:65:4: Incompatible assignment: expected Literal['Color.RED'], got Literal[] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/literals_semantics.toml b/conformance/results/pycroscope/literals_semantics.toml new file mode 100644 index 00000000..89d3a423 --- /dev/null +++ b/conformance/results/pycroscope/literals_semantics.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./literals_semantics.py:10:0: Incompatible assignment: expected Literal[3], got Literal[4] [incompatible_assignment] +./literals_semantics.py:24:4: Incompatible assignment: expected Literal[False], got Literal[0] [incompatible_assignment] +./literals_semantics.py:25:4: Incompatible assignment: expected Literal[0], got Literal[False] [incompatible_assignment] +./literals_semantics.py:33:4: Incompatible assignment: expected Literal[3, 4, 5], got Literal[6, 7, 8] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/namedtuples_define_class.toml b/conformance/results/pycroscope/namedtuples_define_class.toml new file mode 100644 index 00000000..9300c226 --- /dev/null +++ b/conformance/results/pycroscope/namedtuples_define_class.toml @@ -0,0 +1,27 @@ +conformant = "Partial" +notes = """ +Does not support precise type inference for slices over namedtuples. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 29: Unexpected errors ['./namedtuples_define_class.py:29:12: tuple is not equivalent to tuple[int, int]'] +Line 30: Unexpected errors ['./namedtuples_define_class.py:30:12: tuple is not equivalent to tuple[int, int, str]'] +""" +output = """ +./namedtuples_define_class.py:29:12: tuple is not equivalent to tuple[int, int] +./namedtuples_define_class.py:30:12: tuple is not equivalent to tuple[int, int, str] +./namedtuples_define_class.py:32:6: Tuple index out of range: Literal[3] [incompatible_call] +./namedtuples_define_class.py:33:6: Tuple index out of range: Literal[-4] [incompatible_call] +./namedtuples_define_class.py:44:5: Missing required argument 'y' [incompatible_call] +./namedtuples_define_class.py:45:5: Missing required argument 'y' [incompatible_call] +./namedtuples_define_class.py:46:14: Incompatible argument type for y: expected int but got Literal[''] [incompatible_argument] +./namedtuples_define_class.py:47:23: Incompatible argument type for units: expected str but got Literal[3] [incompatible_argument] +./namedtuples_define_class.py:48:5: Takes 3 positional arguments but 4 were given [incompatible_call] +./namedtuples_define_class.py:49:6: Got an unexpected keyword argument 'other' [incompatible_call] +./namedtuples_define_class.py:69:6: Takes 2 positional arguments but 3 were given [incompatible_call] +./namedtuples_define_class.py:76:4: NamedTuple field names cannot start with an underscore [invalid_namedtuple] +./namedtuples_define_class.py:86:4: NamedTuple fields without defaults cannot follow fields with defaults [invalid_namedtuple] +./namedtuples_define_class.py:106:4: Field 'x' conflicts with base NamedTuple field [incompatible_override] +./namedtuples_define_class.py:125:18: Incompatible argument type for value: expected str but got Literal[3.1] [incompatible_argument] +./namedtuples_define_class.py:132:23: NamedTuple classes may only inherit from NamedTuple and Generic [invalid_base] +""" diff --git a/conformance/results/pycroscope/namedtuples_define_functional.toml b/conformance/results/pycroscope/namedtuples_define_functional.toml new file mode 100644 index 00000000..eaa0de90 --- /dev/null +++ b/conformance/results/pycroscope/namedtuples_define_functional.toml @@ -0,0 +1,18 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./namedtuples_define_functional.py:16:7: In call to pycroscope.signature.Point1: Missing required argument 'y' [incompatible_call] +./namedtuples_define_functional.py:21:7: In call to pycroscope.signature.Point2: Missing required argument 'x' [incompatible_call] +./namedtuples_define_functional.py:26:7: In call to pycroscope.signature.Point3: Takes 2 positional arguments but 3 were given [incompatible_call] +./namedtuples_define_functional.py:31:7: In call to pycroscope.signature.Point4: Missing required argument 'y' [incompatible_call] +./namedtuples_define_functional.py:36:17: Incompatible argument type for y: expected int but got Literal['1'] [incompatible_argument] +./namedtuples_define_functional.py:37:7: In call to pycroscope.signature.Point5: Takes 2 positional arguments but 3 were given [incompatible_call] +./namedtuples_define_functional.py:42:17: Incompatible argument type for y: expected int but got Literal['1'] [incompatible_argument] +./namedtuples_define_functional.py:43:16: Incompatible argument type for x: expected int but got Literal[1.1] [incompatible_argument] +./namedtuples_define_functional.py:52:6: Error calling (typename: str, field_names: str | collections.abc.Iterable[str], *, rename: bool = Literal[False], module: str | None = None, defaults: collections.abc.Iterable[Any[explicit]] | None = None) -> type[tuple[Any[explicit], ...]]: Encountered duplicate field name: 'a' [incompatible_call] +./namedtuples_define_functional.py:53:6: Error calling (typename: str, field_names: str | collections.abc.Iterable[str], *, rename: bool = Literal[False], module: str | None = None, defaults: collections.abc.Iterable[Any[explicit]] | None = None) -> type[tuple[Any[explicit], ...]]: Type names and field names cannot be a keyword: 'def' [incompatible_call] +./namedtuples_define_functional.py:54:6: Error calling (typename: str, field_names: str | collections.abc.Iterable[str], *, rename: bool = Literal[False], module: str | None = None, defaults: collections.abc.Iterable[Any[explicit]] | None = None) -> type[tuple[Any[explicit], ...]]: Type names and field names cannot be a keyword: 'def' [incompatible_call] +./namedtuples_define_functional.py:55:6: Error calling (typename: str, field_names: str | collections.abc.Iterable[str], *, rename: bool = Literal[False], module: str | None = None, defaults: collections.abc.Iterable[Any[explicit]] | None = None) -> type[tuple[Any[explicit], ...]]: Field names cannot start with an underscore: '_d' [incompatible_call] +./namedtuples_define_functional.py:69:0: In call to pycroscope.signature.NT7: Missing required argument 'a' [incompatible_call] +""" diff --git a/conformance/results/pycroscope/namedtuples_type_compat.toml b/conformance/results/pycroscope/namedtuples_type_compat.toml new file mode 100644 index 00000000..15ccafae --- /dev/null +++ b/conformance/results/pycroscope/namedtuples_type_compat.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./namedtuples_type_compat.py:22:0: Incompatible assignment: expected tuple[int, int], got Literal[Point(x=1, y=2, units='inches')] [incompatible_assignment] +./namedtuples_type_compat.py:23:0: Incompatible assignment: expected tuple[int, str, str], got Literal[Point(x=1, y=2, units='inches')] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/namedtuples_usage.toml b/conformance/results/pycroscope/namedtuples_usage.toml new file mode 100644 index 00000000..8c47f786 --- /dev/null +++ b/conformance/results/pycroscope/namedtuples_usage.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./namedtuples_usage.py:34:6: Tuple index out of range: Literal[3] [incompatible_call] +./namedtuples_usage.py:35:6: Tuple index out of range: Literal[-4] [incompatible_call] +./namedtuples_usage.py:40:0: Cannot assign to read-only attribute 'x' [incompatible_assignment] +./namedtuples_usage.py:41:0: Object of type tuple[int, int, str] does not support '__setitem__' [unsupported_operation] +./namedtuples_usage.py:42:4: Cannot delete read-only attribute 'x' [incompatible_assignment] +./namedtuples_usage.py:43:4: Object of type tuple[int, int, str] does not support '__delitem__' [unsupported_operation] +./namedtuples_usage.py:52:0: Cannot unpack ./namedtuples_usage.py.Point [bad_unpack] +./namedtuples_usage.py:53:0: Cannot unpack ./namedtuples_usage.py.Point [bad_unpack] +""" diff --git a/conformance/results/pycroscope/narrowing_typeguard.toml b/conformance/results/pycroscope/narrowing_typeguard.toml new file mode 100644 index 00000000..9b982407 --- /dev/null +++ b/conformance/results/pycroscope/narrowing_typeguard.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./narrowing_typeguard.py:102:4: TypeGuard must be used on a function taking at least one positional parameter [invalid_typeguard] +./narrowing_typeguard.py:107:4: TypeGuard must be used on a function taking at least one positional parameter [invalid_typeguard] +./narrowing_typeguard.py:128:19: Incompatible argument type for f: expected (object, /) -> str but got function 'narrowing_typeguard.simple_typeguard' [incompatible_argument] +./narrowing_typeguard.py:148:25: Incompatible argument type for f: expected narrowing_typeguard.CallableStrProto but got function 'narrowing_typeguard.simple_typeguard' [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/narrowing_typeis.toml b/conformance/results/pycroscope/narrowing_typeis.toml new file mode 100644 index 00000000..d466f5fc --- /dev/null +++ b/conformance/results/pycroscope/narrowing_typeis.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./narrowing_typeis.py:110:4: TypeIs must be used on a function taking at least one positional parameter [invalid_typeguard] +./narrowing_typeis.py:115:4: TypeIs must be used on a function taking at least one positional parameter [invalid_typeguard] +./narrowing_typeis.py:137:19: Incompatible argument type for f: expected (object, /) -> str but got function 'narrowing_typeis.simple_typeguard' [incompatible_argument] +./narrowing_typeis.py:157:25: Incompatible argument type for f: expected narrowing_typeis.CallableStrProto but got function 'narrowing_typeis.simple_typeguard' [incompatible_argument] +./narrowing_typeis.py:174:16: Incompatible argument type for f: expected (object, /) -> Annotated[bool, TypeGuardExtension(guarded_type=TypedValue(typ=, literal_only=False))] but got function 'narrowing_typeis.is_int_typeis' [incompatible_argument] +./narrowing_typeis.py:175:13: Incompatible argument type for f: expected (object, /) -> Annotated[bool, TypeIsExtension(guarded_type=TypedValue(typ=, literal_only=False))] but got function 'narrowing_typeis.is_int_typeguard' [incompatible_argument] +./narrowing_typeis.py:196:17: Incompatible argument type for f: expected (object, /) -> Annotated[bool, TypeIsExtension(guarded_type=TypedValue(typ=, literal_only=False))] but got function 'narrowing_typeis.bool_typeis' [incompatible_argument] +./narrowing_typeis.py:200:26: TypeIs narrowed type str is incompatible with parameter x [typeis_must_be_subtype] +./narrowing_typeis.py:204:44: TypeIs narrowed type list[int] is incompatible with parameter x [typeis_must_be_subtype] +""" diff --git a/conformance/results/pycroscope/overloads_basic.toml b/conformance/results/pycroscope/overloads_basic.toml new file mode 100644 index 00000000..beb83647 --- /dev/null +++ b/conformance/results/pycroscope/overloads_basic.toml @@ -0,0 +1,14 @@ +conformant = "Partial" +notes = """ +Does less literal promotion than the test asks for. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 37: Unexpected errors ['./overloads_basic.py:37:12: Literal[0] is not equivalent to int'] +Line 38: Unexpected errors ["./overloads_basic.py:38:12: Literal[b''] is not equivalent to bytes"] +""" +output = """ +./overloads_basic.py:37:12: Literal[0] is not equivalent to int +./overloads_basic.py:38:12: Literal[b''] is not equivalent to bytes +./overloads_basic.py:39:0: Cannot call overloaded function [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/overloads_consistency.toml b/conformance/results/pycroscope/overloads_consistency.toml new file mode 100644 index 00000000..69bde2f9 --- /dev/null +++ b/conformance/results/pycroscope/overloads_consistency.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./overloads_consistency.py:25:0: Overload for 'return_type' is inconsistent with implementation [inconsistent_overload] +./overloads_consistency.py:41:0: Overload for 'parameter_type' is inconsistent with implementation [inconsistent_overload] +""" diff --git a/conformance/results/pycroscope/overloads_definitions.toml b/conformance/results/pycroscope/overloads_definitions.toml new file mode 100644 index 00000000..bb487e49 --- /dev/null +++ b/conformance/results/pycroscope/overloads_definitions.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./overloads_definitions.py:16:0: At least two overload signatures are required [invalid_overload] +./overloads_definitions.py:28:0: Overloaded function is missing an implementation [invalid_overload] +./overloads_definitions.py:59:4: Overloaded function is missing an implementation [invalid_overload] +./overloads_definitions.py:81:4: Overload implementation has incompatible @staticmethod/@classmethod decorator [invalid_overload] +./overloads_definitions.py:86:4: @staticmethod/@classmethod usage must be consistent across overloads [invalid_overload] +./overloads_definitions.py:124:4: @final should be applied only to the overload implementation [invalid_final] +./overloads_definitions.py:139:4: @final should be applied only to the overload implementation [invalid_final] +./overloads_definitions.py:144:4: @final should be applied only to the overload implementation [invalid_final] +./overloads_definitions.py:186:4: Cannot override final attribute final_method [incompatible_override] +./overloads_definitions.py:203:4: Method does not override any base method [override_does_not_override] +./overloads_definitions.py:228:4: @override decorator in invalid location [invalid_override_decorator] +""" diff --git a/conformance/results/pycroscope/overloads_definitions_stub.toml b/conformance/results/pycroscope/overloads_definitions_stub.toml new file mode 100644 index 00000000..5e2d111c --- /dev/null +++ b/conformance/results/pycroscope/overloads_definitions_stub.toml @@ -0,0 +1,17 @@ +conformant = "Unsupported" +notes = """ +Does not support checking stubs. +""" +conformance_automated = "Fail" +errors_diff = """ +Lines 13, 14: Expected error (tag 'func1') +Lines 32, 33, 37: Expected error (tag 'func5') +Lines 39, 41, 44: Expected error (tag 'func6') +Lines 67, 69, 71, 72, 73: Expected error (tag 'invalid_final') +Lines 80, 82, 84, 85, 86: Expected error (tag 'invalid_final_2') +Lines 102, 107, 108, 111, 113: Expected error (tag 'override-final') +Lines 120, 121, 122: Expected error (tag 'bad_override') +Lines 143, 146, 147, 149: Expected error (tag 'override_impl') +""" +output = """ +""" diff --git a/conformance/results/pycroscope/overloads_evaluation.toml b/conformance/results/pycroscope/overloads_evaluation.toml new file mode 100644 index 00000000..f04831ec --- /dev/null +++ b/conformance/results/pycroscope/overloads_evaluation.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./overloads_evaluation.py:38:0: Cannot call overloaded function [incompatible_call] +./overloads_evaluation.py:46:0: Cannot call overloaded function [incompatible_argument] +./overloads_evaluation.py:51:0: Cannot call overloaded function [incompatible_argument] +./overloads_evaluation.py:116:4: Cannot call overloaded function [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/protocols_class_objects.toml b/conformance/results/pycroscope/protocols_class_objects.toml new file mode 100644 index 00000000..e40edf15 --- /dev/null +++ b/conformance/results/pycroscope/protocols_class_objects.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Abstract type[Proto] still allows protocol class objects in some paths. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 29: Expected 1 errors +Line 34: Expected 1 errors +Line 107: Expected 1 errors +""" +output = """ +./protocols_class_objects.py:58:0: Incompatible assignment: expected ./protocols_class_objects.py.ProtoA1, got [incompatible_assignment] +./protocols_class_objects.py:74:0: Incompatible assignment: expected ./protocols_class_objects.py.ProtoB1, got [incompatible_assignment] +./protocols_class_objects.py:104:0: Incompatible assignment: expected ./protocols_class_objects.py.ProtoC1, got [incompatible_assignment] +./protocols_class_objects.py:106:0: Incompatible assignment: expected ./protocols_class_objects.py.ProtoC1, got [incompatible_assignment] +./protocols_class_objects.py:108:0: Incompatible assignment: expected ./protocols_class_objects.py.ProtoC1, got [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/protocols_definition.toml b/conformance/results/pycroscope/protocols_definition.toml new file mode 100644 index 00000000..506df6a7 --- /dev/null +++ b/conformance/results/pycroscope/protocols_definition.toml @@ -0,0 +1,26 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./protocols_definition.py:30:10: Incompatible argument type for things: expected collections.abc.Iterable[./protocols_definition.py.SupportsClose] but got Literal[[1]] [incompatible_argument] +./protocols_definition.py:67:8: Protocol members cannot be defined via assignment to self [invalid_protocol] +./protocols_definition.py:114:0: Incompatible assignment: expected ./protocols_definition.py.Template2, got ./protocols_definition.py.Concrete2_Bad1 [incompatible_assignment] +./protocols_definition.py:115:0: Incompatible assignment: expected ./protocols_definition.py.Template2, got ./protocols_definition.py.Concrete2_Bad2 [incompatible_assignment] +./protocols_definition.py:116:0: Incompatible assignment: expected ./protocols_definition.py.Template2, got ./protocols_definition.py.Concrete2_Bad3 [incompatible_assignment] +./protocols_definition.py:117:0: Incompatible assignment: expected ./protocols_definition.py.Template2, got ./protocols_definition.py.Concrete2_Bad4 [incompatible_assignment] +./protocols_definition.py:156:0: Incompatible assignment: expected ./protocols_definition.py.Template3, got ./protocols_definition.py.Concrete3_Bad1 [incompatible_assignment] +./protocols_definition.py:157:0: Incompatible assignment: expected ./protocols_definition.py.Template3, got ./protocols_definition.py.Concrete3_Bad2 [incompatible_assignment] +./protocols_definition.py:158:0: Incompatible assignment: expected ./protocols_definition.py.Template3, got ./protocols_definition.py.Concrete3_Bad3 [incompatible_assignment] +./protocols_definition.py:159:0: Incompatible assignment: expected ./protocols_definition.py.Template3, got ./protocols_definition.py.Concrete3_Bad4 [incompatible_assignment] +./protocols_definition.py:160:0: Incompatible assignment: expected ./protocols_definition.py.Template3, got ./protocols_definition.py.Concrete3_Bad5 [incompatible_assignment] +./protocols_definition.py:218:0: Incompatible assignment: expected ./protocols_definition.py.Template4, got ./protocols_definition.py.Concrete4_Bad1 [incompatible_assignment] +./protocols_definition.py:219:0: Incompatible assignment: expected ./protocols_definition.py.Template4, got ./protocols_definition.py.Concrete4_Bad2 [incompatible_assignment] +./protocols_definition.py:285:0: Incompatible assignment: expected ./protocols_definition.py.Template5, got ./protocols_definition.py.Concrete5_Bad1 [incompatible_assignment] +./protocols_definition.py:286:0: Incompatible assignment: expected ./protocols_definition.py.Template5, got ./protocols_definition.py.Concrete5_Bad2 [incompatible_assignment] +./protocols_definition.py:287:0: Incompatible assignment: expected ./protocols_definition.py.Template5, got ./protocols_definition.py.Concrete5_Bad3 [incompatible_assignment] +./protocols_definition.py:288:0: Incompatible assignment: expected ./protocols_definition.py.Template5, got ./protocols_definition.py.Concrete5_Bad4 [incompatible_assignment] +./protocols_definition.py:289:0: Incompatible assignment: expected ./protocols_definition.py.Template5, got ./protocols_definition.py.Concrete5_Bad5 [incompatible_assignment] +./protocols_definition.py:339:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad1 [incompatible_assignment] +./protocols_definition.py:340:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad2 [incompatible_assignment] +./protocols_definition.py:341:0: Incompatible assignment: expected ./protocols_definition.py.Template6, got ./protocols_definition.py.Concrete6_Bad3 [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/protocols_explicit.toml b/conformance/results/pycroscope/protocols_explicit.toml new file mode 100644 index 00000000..e0bf74a4 --- /dev/null +++ b/conformance/results/pycroscope/protocols_explicit.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./protocols_explicit.py:27:15: Call to abstract protocol member via super() has no default implementation [bad_super_call] +./protocols_explicit.py:56:8: Incompatible types in assignment to attribute 'rgb': expected tuple[int, int, int], got tuple[int, int, str] [incompatible_assignment] +./protocols_explicit.py:60:4: Cannot instantiate abstract class Point [incompatible_call] +./protocols_explicit.py:89:5: Cannot instantiate abstract class Concrete1 [incompatible_call] +./protocols_explicit.py:134:5: Cannot instantiate abstract class Concrete5 [incompatible_call] +./protocols_explicit.py:164:6: Cannot instantiate abstract class Concrete7A [incompatible_call] +""" diff --git a/conformance/results/pycroscope/protocols_generic.toml b/conformance/results/pycroscope/protocols_generic.toml new file mode 100644 index 00000000..9882a557 --- /dev/null +++ b/conformance/results/pycroscope/protocols_generic.toml @@ -0,0 +1,21 @@ +conformant = "Partial" +notes = """ +Fails to reject duplicate generic/protocol bases. +Treats global object as a literal. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 44: Expected 1 errors +Line 96: Unexpected errors ['./protocols_generic.py:96:12: Literal[] is not equivalent to protocols_generic.ConcreteHasParent'] +""" +output = """ +./protocols_generic.py:40:0: Incompatible assignment: expected protocols_generic.Proto1[int, str], got protocols_generic.Concrete1 [incompatible_assignment] +./protocols_generic.py:56:4: Incompatible assignment: expected protocols_generic.Box[int], got protocols_generic.Box[float | int] [incompatible_assignment] +./protocols_generic.py:66:4: Incompatible assignment: expected protocols_generic.Sender[float | int], got protocols_generic.Sender[int] [incompatible_assignment] +./protocols_generic.py:74:4: Incompatible assignment: expected protocols_generic.AttrProto[float | int], got protocols_generic.AttrProto[int] [incompatible_assignment] +./protocols_generic.py:75:4: Incompatible assignment: expected protocols_generic.AttrProto[int], got protocols_generic.AttrProto[float | int] [incompatible_assignment] +./protocols_generic.py:96:12: Literal[] is not equivalent to protocols_generic.ConcreteHasParent +./protocols_generic.py:145:0: Incompatible assignment: expected protocols_generic.HasPropertyProto, got protocols_generic.ConcreteHasProperty2 [incompatible_assignment] +./protocols_generic.py:146:0: Incompatible assignment: expected protocols_generic.HasPropertyProto, got protocols_generic.ConcreteHasProperty3 [incompatible_assignment] +./protocols_generic.py:147:0: Incompatible assignment: expected protocols_generic.HasPropertyProto, got protocols_generic.ConcreteHasProperty4 [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/protocols_merging.toml b/conformance/results/pycroscope/protocols_merging.toml new file mode 100644 index 00000000..78edb0b6 --- /dev/null +++ b/conformance/results/pycroscope/protocols_merging.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./protocols_merging.py:52:0: Incompatible assignment: expected ./protocols_merging.py.SizedAndClosable1, got ./protocols_merging.py.SCConcrete2 [incompatible_assignment] +./protocols_merging.py:53:0: Incompatible assignment: expected ./protocols_merging.py.SizedAndClosable2, got ./protocols_merging.py.SCConcrete2 [incompatible_assignment] +./protocols_merging.py:54:0: Incompatible assignment: expected ./protocols_merging.py.SizedAndClosable3, got ./protocols_merging.py.SCConcrete2 [incompatible_assignment] +./protocols_merging.py:67:15: Protocols can only inherit from protocol bases [invalid_base] +./protocols_merging.py:82:4: Cannot instantiate abstract class SizedAndClosable4 [incompatible_call] +./protocols_merging.py:83:0: Incompatible assignment: expected ./protocols_merging.py.SizedAndClosable4, got ./protocols_merging.py.SCConcrete1 [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/protocols_modules.toml b/conformance/results/pycroscope/protocols_modules.toml new file mode 100644 index 00000000..21a19003 --- /dev/null +++ b/conformance/results/pycroscope/protocols_modules.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./protocols_modules.py:26:0: Incompatible assignment: expected protocols_modules.Options2, got module '_protocols_modules1' [incompatible_assignment] +./protocols_modules.py:48:0: Incompatible assignment: expected protocols_modules.Reporter2, got module '_protocols_modules2' [incompatible_assignment] +./protocols_modules.py:49:0: Incompatible assignment: expected protocols_modules.Reporter3, got module '_protocols_modules2' [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/protocols_recursive.toml b/conformance/results/pycroscope/protocols_recursive.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/protocols_recursive.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/protocols_runtime_checkable.toml b/conformance/results/pycroscope/protocols_runtime_checkable.toml new file mode 100644 index 00000000..adc077e7 --- /dev/null +++ b/conformance/results/pycroscope/protocols_runtime_checkable.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./protocols_runtime_checkable.py:23:21: Second argument to "isinstance" cannot be a protocol that is not @runtime_checkable [incompatible_argument] +./protocols_runtime_checkable.py:55:21: Second argument to "issubclass" cannot be a runtime-checkable protocol with non-method members [incompatible_argument] +./protocols_runtime_checkable.py:61:21: Second argument to "issubclass" cannot be a runtime-checkable protocol with non-method members [incompatible_argument] +./protocols_runtime_checkable.py:88:18: First argument to "isinstance" has unsafe overlap between 'Concrete3A' and protocol 'Proto3' [incompatible_argument] +./protocols_runtime_checkable.py:91:18: First argument to "isinstance" has unsafe overlap between 'Concrete3B' and protocol 'Proto3' [incompatible_argument] +./protocols_runtime_checkable.py:94:18: First argument to "issubclass" has unsafe overlap between 'Concrete3A' and protocol 'Proto3' [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/protocols_self.toml b/conformance/results/pycroscope/protocols_self.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/protocols_self.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/protocols_subtyping.toml b/conformance/results/pycroscope/protocols_subtyping.toml new file mode 100644 index 00000000..3e0ba0a3 --- /dev/null +++ b/conformance/results/pycroscope/protocols_subtyping.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./protocols_subtyping.py:16:5: Cannot instantiate protocol class Proto1 [incompatible_call] +./protocols_subtyping.py:38:4: Incompatible assignment: expected ./protocols_subtyping.py.Concrete2, got ./protocols_subtyping.py.Proto2 [incompatible_assignment] +./protocols_subtyping.py:55:4: Incompatible assignment: expected ./protocols_subtyping.py.Proto3, got ./protocols_subtyping.py.Proto2 [incompatible_assignment] +./protocols_subtyping.py:79:4: Incompatible assignment: expected ./protocols_subtyping.py.Proto4[int, float | int], got ./protocols_subtyping.py.Proto5[int] [incompatible_assignment] +./protocols_subtyping.py:80:4: Incompatible assignment: expected ./protocols_subtyping.py.Proto5[float | int], got ./protocols_subtyping.py.Proto4[int, int] [incompatible_assignment] +./protocols_subtyping.py:102:4: Incompatible assignment: expected ./protocols_subtyping.py.Proto7[int, float | int], got ./protocols_subtyping.py.Proto6[float | int, float | int] [incompatible_assignment] +./protocols_subtyping.py:103:4: Incompatible assignment: expected ./protocols_subtyping.py.Proto7[float | int, object], got ./protocols_subtyping.py.Proto6[float | int, float | int] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/protocols_variance.toml b/conformance/results/pycroscope/protocols_variance.toml new file mode 100644 index 00000000..70d6e1c4 --- /dev/null +++ b/conformance/results/pycroscope/protocols_variance.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./protocols_variance.py:21:0: T1 should be covariant [invalid_protocol] +./protocols_variance.py:40:0: T3 should be contravariant [invalid_protocol] +./protocols_variance.py:56:0: T1 should be contravariant [invalid_protocol] +./protocols_variance.py:61:0: T1_co should be contravariant [invalid_protocol] +./protocols_variance.py:66:0: T1 should be covariant [invalid_protocol] +./protocols_variance.py:71:0: T1_contra should be covariant [invalid_protocol] +./protocols_variance.py:104:0: T1 should be covariant [invalid_protocol] +""" diff --git a/conformance/results/pycroscope/qualifiers_annotated.toml b/conformance/results/pycroscope/qualifiers_annotated.toml new file mode 100644 index 00000000..97000ee4 --- /dev/null +++ b/conformance/results/pycroscope/qualifiers_annotated.toml @@ -0,0 +1,32 @@ +conformant = "Partial" +notes = """ +Fails to reject various weird annotations. +False positive on lambda in Annotated. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 44: Expected 1 errors +Line 49: Expected 1 errors +Line 88: Expected 1 errors +Line 55: Unexpected errors ['./qualifiers_annotated.py:55:46: Type parameter is not valid in this annotation context [invalid_annotation]'] +""" +output = """ +./qualifiers_annotated.py:38:6: Invalid type annotation [, ] [invalid_annotation] +./qualifiers_annotated.py:39:6: Invalid type annotation ((, ),) [invalid_annotation] +./qualifiers_annotated.py:40:6: Unrecognized annotation [invalid_annotation] +./qualifiers_annotated.py:41:6: Invalid type annotation {'a': 'b'} [invalid_annotation] +./qualifiers_annotated.py:45:16: Undefined name: var1 [undefined_name] +./qualifiers_annotated.py:46:6: Invalid type annotation True [invalid_annotation] +./qualifiers_annotated.py:47:7: Invalid type annotation 1 [invalid_annotation] +./qualifiers_annotated.py:48:17: Annotated[type 'list', (<+list is_truthy None> == NullConstraint())] is always True because it does not provide __bool__ [type_always_true] +./qualifiers_annotated.py:55:46: Type parameter is not valid in this annotation context [invalid_annotation] +./qualifiers_annotated.py:59:7: Annotated[] requires at least two arguments [invalid_annotation] +./qualifiers_annotated.py:71:0: Incompatible assignment: expected type, got Literal[typing.Annotated[int, '']] [incompatible_assignment] +./qualifiers_annotated.py:72:0: Incompatible assignment: expected type, got TypeForm[.SmallInt] (synthetic from Literal[typing.Annotated[int, '']]) [incompatible_assignment] +./qualifiers_annotated.py:79:6: Incompatible argument type for x: expected type[~T@./qualifiers_annotated.py.func4..func4] but got Literal[typing.Annotated[str, '']] [incompatible_argument] +./qualifiers_annotated.py:80:6: Incompatible argument type for x: expected type[~T@./qualifiers_annotated.py.func4..func4] but got TypeForm[.SmallInt] (synthetic from Literal[typing.Annotated[int, '']]) [incompatible_argument] +./qualifiers_annotated.py:86:0: Annotated cannot be called [not_callable] +./qualifiers_annotated.py:87:0: Annotated cannot be called [not_callable] +""" diff --git a/conformance/results/pycroscope/qualifiers_final_annotation.toml b/conformance/results/pycroscope/qualifiers_final_annotation.toml new file mode 100644 index 00000000..07fc0d81 --- /dev/null +++ b/conformance/results/pycroscope/qualifiers_final_annotation.toml @@ -0,0 +1,33 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./qualifiers_final_annotation.py:16:6: Final annotation without assignment requires an explicit type [invalid_qualifier] +./qualifiers_final_annotation.py:18:6: Invalid type annotation (, ) [invalid_annotation] +./qualifiers_final_annotation.py:34:9: Final annotation without assignment requires an explicit type [invalid_qualifier] +./qualifiers_final_annotation.py:34:4: Final class attributes without initializers must be assigned in __init__ [invalid_qualifier] +./qualifiers_final_annotation.py:38:4: Final class attributes without initializers must be assigned in __init__ [invalid_qualifier] +./qualifiers_final_annotation.py:54:8: Cannot assign to final name ID5 [incompatible_assignment] +./qualifiers_final_annotation.py:62:18: Final instance attributes may be declared only in __init__ [invalid_qualifier] +./qualifiers_final_annotation.py:63:18: Final instance attributes may be declared only in __init__ [invalid_qualifier] +./qualifiers_final_annotation.py:65:8: Cannot assign to final name ID7 [incompatible_assignment] +./qualifiers_final_annotation.py:67:8: Cannot assign to final name ID7 [incompatible_assignment] +./qualifiers_final_annotation.py:71:0: Cannot assign to final name RATE [incompatible_assignment] +./qualifiers_final_annotation.py:81:0: Cannot assign to final name DEFAULT_ID [incompatible_assignment] +./qualifiers_final_annotation.py:94:4: Cannot override final attribute BORDER_WIDTH [incompatible_override] +./qualifiers_final_annotation.py:107:12: Final cannot be combined with ClassVar [invalid_qualifier] +./qualifiers_final_annotation.py:108:12: Final cannot be combined with ClassVar [invalid_qualifier] +./qualifiers_final_annotation.py:118:3: Unrecognized annotation typing.Final[] [invalid_annotation] +./qualifiers_final_annotation.py:121:13: Unexpected Final annotation [invalid_qualifier] +./qualifiers_final_annotation.py:134:0: In call to pycroscope.signature.N: Missing required argument 'x' [incompatible_call] +./qualifiers_final_annotation.py:135:4: Incompatible argument type for x: expected int but got Literal[''] [incompatible_argument] +./qualifiers_final_annotation.py:135:10: Incompatible argument type for y: expected int but got Literal[''] [incompatible_argument] +./qualifiers_final_annotation.py:141:4: Cannot assign to final name ID1 [incompatible_assignment] +./qualifiers_final_annotation.py:145:4: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:147:9: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:149:8: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:152:29: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:155:8: Cannot assign to final name x [incompatible_assignment] +./qualifiers_final_annotation.py:166:0: Cannot assign to final name TEN [incompatible_assignment] +./qualifiers_final_annotation.py:170:0: Cannot assign to final name PI [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/qualifiers_final_decorator.toml b/conformance/results/pycroscope/qualifiers_final_decorator.toml new file mode 100644 index 00000000..fc2652a7 --- /dev/null +++ b/conformance/results/pycroscope/qualifiers_final_decorator.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./qualifiers_final_decorator.py:21:15: Cannot inherit from final class [invalid_base] +./qualifiers_final_decorator.py:56:4: Cannot override final attribute method1 [incompatible_override] +./qualifiers_final_decorator.py:60:4: Cannot override final attribute method2 [incompatible_override] +./qualifiers_final_decorator.py:64:4: Cannot override final attribute method3 [incompatible_override] +./qualifiers_final_decorator.py:75:4: Cannot override final attribute method4 [incompatible_override] +./qualifiers_final_decorator.py:86:4: @final should be applied only to the overload implementation [invalid_final] +./qualifiers_final_decorator.py:89:4: Cannot override final attribute method [incompatible_override] +./qualifiers_final_decorator.py:102:4: Cannot override final attribute method [incompatible_override] +./qualifiers_final_decorator.py:118:4: Cannot override final attribute method [incompatible_override] +./qualifiers_final_decorator.py:126:0: @final is not allowed on non-method functions [invalid_final] +""" diff --git a/conformance/results/pycroscope/specialtypes_any.toml b/conformance/results/pycroscope/specialtypes_any.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/specialtypes_any.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/specialtypes_never.toml b/conformance/results/pycroscope/specialtypes_never.toml new file mode 100644 index 00000000..e6f61291 --- /dev/null +++ b/conformance/results/pycroscope/specialtypes_never.toml @@ -0,0 +1,17 @@ +conformant = "Partial" +notes = """ +Does not enforce invariance in some contexts +Does not allow Any to be assigned to Never +""" +conformance_automated = "Fail" +errors_diff = """ +Line 104: Expected 1 errors +Line 51: Unexpected errors ['./specialtypes_never.py:51:4: Incompatible return type: expected list[Never], got Literal[[]] [incompatible_return_value]'] +Line 84: Unexpected errors ['./specialtypes_never.py:84:4: Incompatible assignment: expected Never, got Any[explicit] [incompatible_assignment]'] +""" +output = """ +./specialtypes_never.py:19:0: Function is annotated as NoReturn but may return [no_return_may_return] +./specialtypes_never.py:51:4: Incompatible return type: expected list[Never], got Literal[[]] [incompatible_return_value] +./specialtypes_never.py:84:4: Incompatible assignment: expected Never, got Any[explicit] [incompatible_assignment] +./specialtypes_never.py:85:4: Incompatible assignment: expected list[int], got list[Never] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/specialtypes_none.toml b/conformance/results/pycroscope/specialtypes_none.toml new file mode 100644 index 00000000..f3684f77 --- /dev/null +++ b/conformance/results/pycroscope/specialtypes_none.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./specialtypes_none.py:21:6: Incompatible argument type for val1: expected None but got type 'NoneType' [incompatible_argument] +./specialtypes_none.py:27:0: Incompatible assignment: expected collections.abc.Iterable, got None [incompatible_assignment] +./specialtypes_none.py:41:6: Incompatible argument type for val1: expected type[NoneType] but got None [incompatible_argument] +""" diff --git a/conformance/results/pycroscope/specialtypes_promotions.toml b/conformance/results/pycroscope/specialtypes_promotions.toml new file mode 100644 index 00000000..8e32e247 --- /dev/null +++ b/conformance/results/pycroscope/specialtypes_promotions.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./specialtypes_promotions.py:13:4: float has no attribute 'numerator' [undefined_attribute] +""" diff --git a/conformance/results/pycroscope/specialtypes_type.toml b/conformance/results/pycroscope/specialtypes_type.toml new file mode 100644 index 00000000..3bfe1708 --- /dev/null +++ b/conformance/results/pycroscope/specialtypes_type.toml @@ -0,0 +1,14 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./specialtypes_type.py:56:6: Incompatible argument type for user_class: expected type[./specialtypes_type.py.BasicUser] | type[./specialtypes_type.py.ProUser] but got [incompatible_argument] +./specialtypes_type.py:70:6: Incompatible argument type for x: expected type[~T@./specialtypes_type.py.func5..func5] but got Literal[typing.Callable] [incompatible_argument] +./specialtypes_type.py:76:11: Type[] requires a single argument [invalid_annotation] +./specialtypes_type.py:117:4: type[object] has no attribute 'unknown' [undefined_attribute] +./specialtypes_type.py:120:4: type[object] has no attribute 'unknown' [undefined_attribute] +./specialtypes_type.py:143:0: Literal[typing.Type] has no attribute 'unknown' [undefined_attribute] +./specialtypes_type.py:144:0: Literal[typing.Type[typing.Any]] has no attribute 'unknown' [undefined_attribute] +./specialtypes_type.py:145:0: type 'type' has no attribute 'unknown' [undefined_attribute] +./specialtypes_type.py:146:0: Literal[type[typing.Any]] has no attribute 'unknown' [undefined_attribute] +""" diff --git a/conformance/results/pycroscope/tuples_type_compat.toml b/conformance/results/pycroscope/tuples_type_compat.toml new file mode 100644 index 00000000..cefaf21a --- /dev/null +++ b/conformance/results/pycroscope/tuples_type_compat.toml @@ -0,0 +1,29 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./tuples_type_compat.py:15:4: Incompatible assignment: expected tuple[int, int], got tuple[float | int, complex | float | int] [incompatible_assignment] +./tuples_type_compat.py:29:4: Incompatible assignment: expected tuple[int, *tuple[int, ...]], got tuple[int, ...] [incompatible_assignment] +./tuples_type_compat.py:32:4: Incompatible assignment: expected tuple[int], got tuple[int, *tuple[int, ...]] [incompatible_assignment] +./tuples_type_compat.py:33:4: Incompatible assignment: expected tuple[int], got tuple[int, ...] [incompatible_assignment] +./tuples_type_compat.py:43:4: Incompatible assignment: expected tuple[int], got tuple[int, ...] [incompatible_assignment] +./tuples_type_compat.py:62:4: Incompatible assignment: expected tuple[int, int], got tuple[int, ...] [incompatible_assignment] +./tuples_type_compat.py:76:20: tuple[int] is not equivalent to .Func5Input = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] +./tuples_type_compat.py:81:20: tuple[str, str] | tuple[int, int] is not equivalent to .Func5Input = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] +./tuples_type_compat.py:86:20: tuple[int, str, int] is not equivalent to .Func5Input = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] +./tuples_type_compat.py:102:24: tuple[int] is not equivalent to .Func6Input = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] +./tuples_type_compat.py:107:24: tuple[str, str] | tuple[int, int] is not equivalent to .Func6Input = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] +./tuples_type_compat.py:112:24: tuple[int, str, int] is not equivalent to .Func6Input = tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int] +./tuples_type_compat.py:126:24: .Func7Input = tuple[int | str, int | str] is not equivalent to tuple[int | str, str] +./tuples_type_compat.py:129:24: .Func7Input = tuple[int | str, int | str] is not equivalent to tuple[int | str, int] +./tuples_type_compat.py:157:0: Incompatible assignment: expected tuple[int, str], got Literal[(1, '', '')] [incompatible_assignment] +./tuples_type_compat.py:162:0: Incompatible assignment: expected tuple[int, *tuple[str, ...]], got Literal[(1, 1, '')] [incompatible_assignment] +./tuples_type_compat.py:163:0: Incompatible assignment: expected tuple[int, *tuple[str, ...]], got Literal[(1, '', 1)] [incompatible_assignment] +./tuples_type_compat.py:169:0: Incompatible assignment: expected tuple[int, *tuple[str, ...], int], got Literal[(1, '', '')] [incompatible_assignment] +./tuples_type_compat.py:170:0: Incompatible assignment: expected tuple[int, *tuple[str, ...], int], got Literal[(1, '', '', 1.2)] [incompatible_assignment] +./tuples_type_compat.py:175:0: Incompatible assignment: expected tuple[*tuple[str, ...], int], got Literal[(1, '', 1)] [incompatible_assignment] +./tuples_type_compat.py:176:0: Incompatible assignment: expected tuple[*tuple[str, ...], int], got Literal[('', '', 1.2)] [incompatible_assignment] +./tuples_type_compat.py:181:4: Incompatible assignment: expected tuple[str, str, int], got tuple[str, str] [incompatible_assignment] +./tuples_type_compat.py:184:4: Incompatible assignment: expected tuple[str, str, str, *tuple[str, ...]], got tuple[str, str] [incompatible_assignment] +./tuples_type_compat.py:188:4: Incompatible assignment: expected tuple[*tuple[str, ...], str, str, str], got tuple[str, str] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/tuples_type_form.toml b/conformance/results/pycroscope/tuples_type_form.toml new file mode 100644 index 00000000..021d0002 --- /dev/null +++ b/conformance/results/pycroscope/tuples_type_form.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./tuples_type_form.py:12:0: Incompatible assignment: expected tuple[int], got Literal[(1, 2)] [incompatible_assignment] +./tuples_type_form.py:14:0: Incompatible assignment: expected tuple[int, int], got Literal[(1,)] [incompatible_assignment] +./tuples_type_form.py:15:0: Incompatible assignment: expected tuple[int, int], got Literal[(1, '')] [incompatible_assignment] +./tuples_type_form.py:25:0: Incompatible assignment: expected tuple[()], got Literal[(1,)] [incompatible_assignment] +./tuples_type_form.py:36:0: Incompatible assignment: expected tuple[int, ...], got Literal[(1, 2, 3, '')] [incompatible_assignment] +./tuples_type_form.py:40:5: Ellipsis can be used only in tuple[T, ...] [invalid_annotation] +./tuples_type_form.py:41:5: Ellipsis can be used only in tuple[T, ...] [invalid_annotation] +./tuples_type_form.py:42:5: Ellipsis can be used only in tuple[T, ...] [invalid_annotation] +./tuples_type_form.py:43:5: Ellipsis can be used only in tuple[T, ...] [invalid_annotation] +./tuples_type_form.py:44:5: Ellipsis can be used only in tuple[T, ...] [invalid_annotation] +./tuples_type_form.py:45:5: Ellipsis can be used only in tuple[T, ...] [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/tuples_unpacked.toml b/conformance/results/pycroscope/tuples_unpacked.toml new file mode 100644 index 00000000..f7d1ae06 --- /dev/null +++ b/conformance/results/pycroscope/tuples_unpacked.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./tuples_unpacked.py:40:4: Only one unbounded tuple can be used inside a tuple type [invalid_annotation] +./tuples_unpacked.py:41:4: Only one unbounded tuple can be used inside a tuple type [invalid_annotation] +./tuples_unpacked.py:51:8: Only one unbounded tuple can be used inside a tuple type [invalid_annotation] +./tuples_unpacked.py:59:5: Only one unbounded tuple can be used inside a tuple type [invalid_annotation] +./tuples_unpacked.py:60:5: Only one unbounded tuple can be used inside a tuple type [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/typeddicts_alt_syntax.toml b/conformance/results/pycroscope/typeddicts_alt_syntax.toml new file mode 100644 index 00000000..a91070ec --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_alt_syntax.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_alt_syntax.py:23:43: TypedDict fields argument must be a dictionary literal [incompatible_call] +./typeddicts_alt_syntax.py:27:44: TypedDict field names must be string literals [incompatible_call] +./typeddicts_alt_syntax.py:31:26: TypedDict named 'WrongName' must be assigned to a variable with the same name [must_have_same_name] +./typeddicts_alt_syntax.py:35:71: TypedDict takes either a dict or keyword arguments, but not both [incompatible_call] +./typeddicts_alt_syntax.py:45:0: Incompatible assignment: expected TypedDict({"name": str, "year": int}), got Literal[{'name': 'Blade Runner', 'year': ''}] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/typeddicts_class_syntax.toml b/conformance/results/pycroscope/typeddicts_class_syntax.toml new file mode 100644 index 00000000..87b463a5 --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_class_syntax.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_class_syntax.py:29:4: Methods are not allowed in TypedDict definitions [invalid_typeddict] +./typeddicts_class_syntax.py:34:4: Methods are not allowed in TypedDict definitions [invalid_typeddict] +./typeddicts_class_syntax.py:39:4: Methods are not allowed in TypedDict definitions [invalid_typeddict] +./typeddicts_class_syntax.py:44:31: TypedDict definitions cannot specify a metaclass [invalid_typeddict] +./typeddicts_class_syntax.py:49:31: Unexpected keyword argument 'other' in TypedDict definition [invalid_typeddict] +""" diff --git a/conformance/results/pycroscope/typeddicts_extra_items.toml b/conformance/results/pycroscope/typeddicts_extra_items.toml new file mode 100644 index 00000000..fa51d53a --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_extra_items.toml @@ -0,0 +1,33 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_extra_items.py:15:0: Incompatible assignment: expected TypedDict({"name": str, "__extra_items__": bool}, closed=True), got Literal[{'name': 'Blade Runner', 'year': 1982}] [incompatible_assignment] +./typeddicts_extra_items.py:22:0: Incompatible assignment: expected TypedDict({"name": str, "__extra_items__": bool}, closed=True), got Literal[{'name': 'Blade Runner', 'year': 1982}] [incompatible_assignment] +./typeddicts_extra_items.py:39:0: Incompatible assignment: expected TypedDict({"name": str, "year": int, "__extra_items__": ReadOnly[int | None]}, closed=True), got Literal[{'name': 'Blade Runner', 'year': None}] [incompatible_assignment] +./typeddicts_extra_items.py:49:34: Argument to "closed" must be a literal True or False [invalid_typeddict] +./typeddicts_extra_items.py:67:0: Cannot set 'closed=False' when superclass is closed or has 'extra_items' [invalid_typeddict] +./typeddicts_extra_items.py:73:0: Cannot set 'closed=False' when superclass is closed or has 'extra_items' [invalid_typeddict] +./typeddicts_extra_items.py:92:4: "MovieC" is a closed TypedDict; extra key 'age' not allowed [invalid_typeddict] +./typeddicts_extra_items.py:95:4: "MovieD" is a closed TypedDict; extra key 'age' not allowed [invalid_typeddict] +./typeddicts_extra_items.py:109:0: Cannot set 'closed=True' when superclass has non-read-only 'extra_items' [invalid_typeddict] +./typeddicts_extra_items.py:114:49: 'extra_items' value cannot be 'Required[...]' [invalid_qualifier] +./typeddicts_extra_items.py:117:56: 'extra_items' value cannot be 'NotRequired[...]' [invalid_qualifier] +./typeddicts_extra_items.py:128:14: Cannot delete required TypedDict key Literal['name'] [incompatible_argument] +./typeddicts_extra_items.py:143:0: Got an unexpected keyword argument 'year' [incompatible_call] +./typeddicts_extra_items.py:174:0: Cannot change 'extra_items' type unless it is 'ReadOnly' in the superclass [invalid_typeddict] +./typeddicts_extra_items.py:185:4: Required key 'year' is not known to base TypedDict [invalid_typeddict] +./typeddicts_extra_items.py:188:4: int is not consistent with 'extra_items' type int | None [invalid_typeddict] +./typeddicts_extra_items.py:197:4: str is not assignable to 'extra_items' type int | None [invalid_typeddict] +./typeddicts_extra_items.py:215:0: Incompatible assignment: expected TypedDict({"name": str, "__extra_items__": int | None}, closed=True), got TypedDict({"name": str, "year": NotRequired[int], "__extra_items__": int | None}, closed=True) [incompatible_assignment] +./typeddicts_extra_items.py:222:0: Incompatible assignment: expected TypedDict({"name": str, "__extra_items__": int | None}, closed=True), got TypedDict({"name": str, "year": int | None, "__extra_items__": int | None}, closed=True) [incompatible_assignment] +./typeddicts_extra_items.py:242:0: Incompatible assignment: expected TypedDict({"name": str, "__extra_items__": ReadOnly[str | int]}, closed=True), got TypedDict({"name": str, "actors": list[str], "__extra_items__": int}, closed=True) [incompatible_assignment] +./typeddicts_extra_items.py:256:0: Incompatible assignment: expected TypedDict({"name": str, "__extra_items__": int}, closed=True), got TypedDict({"name": str, "__extra_items__": str}, closed=True) [incompatible_assignment] +./typeddicts_extra_items.py:257:0: Incompatible assignment: expected TypedDict({"name": str, "__extra_items__": str}, closed=True), got TypedDict({"name": str, "__extra_items__": int}, closed=True) [incompatible_assignment] +./typeddicts_extra_items.py:268:0: Incompatible assignment: expected TypedDict({"name": str, "__extra_items__": int}, closed=True), got TypedDict({"name": str}) [incompatible_assignment] +./typeddicts_extra_items.py:278:0: Got an unexpected keyword argument 'year' [incompatible_call] +./typeddicts_extra_items.py:285:0: Incompatible argument type for %kwargs: expected dict[str, int] but got [incompatible_argument] +./typeddicts_extra_items.py:293:0: Incompatible argument type for %kwargs: expected dict[str, Never] but got [incompatible_argument] +./typeddicts_extra_items.py:303:0: Incompatible assignment: expected collections.abc.Mapping[str, int], got TypedDict({"name": str, "__extra_items__": int}, closed=True) [incompatible_assignment] +./typeddicts_extra_items.py:352:4: Incompatible assignment: expected TypedDict({"__extra_items__": int}, closed=True), got dict[str, int] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/typeddicts_final.toml b/conformance/results/pycroscope/typeddicts_final.toml new file mode 100644 index 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_final.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/pycroscope/typeddicts_inheritance.toml b/conformance/results/pycroscope/typeddicts_inheritance.toml new file mode 100644 index 00000000..6dace629 --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_inheritance.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_inheritance.py:44:30: TypedDict classes may only inherit from TypedDict types and Generic [invalid_base] +./typeddicts_inheritance.py:55:3: Incompatible TypedDict override for key 'x' [invalid_typeddict] +./typeddicts_inheritance.py:65:0: TypedDict base classes define key 'x' with incompatible types [invalid_base] +""" diff --git a/conformance/results/pycroscope/typeddicts_operations.toml b/conformance/results/pycroscope/typeddicts_operations.toml new file mode 100644 index 00000000..20850460 --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_operations.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_operations.py:22:0: Value for key 'name' must be str, not Literal[1982] [incompatible_argument] +./typeddicts_operations.py:23:0: Value for key 'year' must be int, not Literal[''] [incompatible_argument] +./typeddicts_operations.py:24:6: Key 'other' does not exist in TypedDict({"name": str, "year": int}) [invalid_typeddict_key] +./typeddicts_operations.py:26:12: Unknown TypedDict key 'other' [invalid_typeddict_key] +./typeddicts_operations.py:28:0: Incompatible assignment: expected TypedDict({"name": str, "year": int}), got Literal[{'name': 'Blade Runner'}] [incompatible_assignment] +./typeddicts_operations.py:29:0: Incompatible assignment: expected TypedDict({"name": str, "year": int}), got Literal[{'name': 'Blade Runner', 'year': 1982.1}] [incompatible_assignment] +./typeddicts_operations.py:32:0: Incompatible assignment: expected TypedDict({"name": str, "year": int}), got Literal[{'name': '', 'year': 1900, 'other': 2}] [incompatible_assignment] +./typeddicts_operations.py:37:4: Incompatible assignment: expected TypedDict({"name": str, "year": int}), got [incompatible_assignment] +./typeddicts_operations.py:44:0: Unknown TypedDict key 'other' [invalid_typeddict_key] +./typeddicts_operations.py:47:0: Cannot call clear() on non-closed TypedDict [incompatible_call] +./typeddicts_operations.py:49:10: Cannot delete required TypedDict key Literal['name'] [incompatible_argument] +./typeddicts_operations.py:62:0: Cannot call clear() on non-closed TypedDict [incompatible_call] +""" diff --git a/conformance/results/pycroscope/typeddicts_readonly.toml b/conformance/results/pycroscope/typeddicts_readonly.toml new file mode 100644 index 00000000..51ab8300 --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_readonly.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_readonly.py:24:3: Cannot set readonly key 'members' in TypedDict TypedDict({"name": str, "members": Readonly[list[str]]}) [readonly_typeddict] +./typeddicts_readonly.py:36:3: Cannot set readonly key 'members' in TypedDict TypedDict({"name": str, "members": Readonly[list[str]]}) [readonly_typeddict] +./typeddicts_readonly.py:50:3: Cannot set readonly key 'title' in TypedDict TypedDict({"title": Readonly[str], "year": NotRequired[Readonly[int]]}) [readonly_typeddict] +./typeddicts_readonly.py:51:3: Cannot set readonly key 'year' in TypedDict TypedDict({"title": Readonly[str], "year": NotRequired[Readonly[int]]}) [readonly_typeddict] +./typeddicts_readonly.py:60:3: Cannot set readonly key 'title' in TypedDict TypedDict({"title": Readonly[str], "year": NotRequired[Readonly[int]]}) [readonly_typeddict] +./typeddicts_readonly.py:61:3: Cannot set readonly key 'year' in TypedDict TypedDict({"title": Readonly[str], "year": NotRequired[Readonly[int]]}) [readonly_typeddict] +""" diff --git a/conformance/results/pycroscope/typeddicts_readonly_consistency.toml b/conformance/results/pycroscope/typeddicts_readonly_consistency.toml new file mode 100644 index 00000000..3fd93c95 --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_readonly_consistency.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_readonly_consistency.py:37:4: Incompatible assignment: expected TypedDict({"x": int, "y": NotRequired[str]}), got TypedDict({"x": int}) [incompatible_assignment] +./typeddicts_readonly_consistency.py:38:4: Incompatible assignment: expected TypedDict({"x": int, "y": NotRequired[str]}), got TypedDict({"x": int, "y": NotRequired[Readonly[str]]}) [incompatible_assignment] +./typeddicts_readonly_consistency.py:40:4: Incompatible assignment: expected TypedDict({"x": int, "y": NotRequired[Readonly[str]]}), got TypedDict({"x": int}) [incompatible_assignment] +./typeddicts_readonly_consistency.py:81:4: Incompatible assignment: expected TypedDict({"x": NotRequired[str]}), got TypedDict({"x": NotRequired[Readonly[str]]}) [incompatible_assignment] +./typeddicts_readonly_consistency.py:82:4: Incompatible assignment: expected TypedDict({"x": NotRequired[str]}), got TypedDict({"x": str}) [incompatible_assignment] +./typeddicts_readonly_consistency.py:84:4: Incompatible assignment: expected TypedDict({"x": str}), got TypedDict({"x": NotRequired[Readonly[str]]}) [incompatible_assignment] +./typeddicts_readonly_consistency.py:85:4: Incompatible assignment: expected TypedDict({"x": str}), got TypedDict({"x": NotRequired[str]}) [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/typeddicts_readonly_inheritance.toml b/conformance/results/pycroscope/typeddicts_readonly_inheritance.toml new file mode 100644 index 00000000..f04b52a0 --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_readonly_inheritance.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_readonly_inheritance.py:36:3: Cannot set readonly key 'name' in TypedDict TypedDict({"name": Readonly[str], "year": int}) [readonly_typeddict] +./typeddicts_readonly_inheritance.py:50:4: Incompatible TypedDict override for key 'alt' [invalid_typeddict] +./typeddicts_readonly_inheritance.py:65:0: Incompatible assignment: expected TypedDict({"name": Readonly[str]}), got Literal[{}] [incompatible_assignment] +./typeddicts_readonly_inheritance.py:82:0: Value for key 'ident' must be str, not Literal[3] [incompatible_argument] +./typeddicts_readonly_inheritance.py:83:0: Incompatible assignment: expected TypedDict({"ident": str}), got Literal[{'ident': 3}] [incompatible_assignment] +./typeddicts_readonly_inheritance.py:84:0: Incompatible assignment: expected TypedDict({"ident": str}), got Literal[{}] [incompatible_assignment] +./typeddicts_readonly_inheritance.py:94:4: Incompatible TypedDict override for key 'a' [invalid_typeddict] +./typeddicts_readonly_inheritance.py:98:4: Incompatible TypedDict override for key 'a' [invalid_typeddict] +./typeddicts_readonly_inheritance.py:106:4: Incompatible TypedDict override for key 'c' [invalid_typeddict] +./typeddicts_readonly_inheritance.py:119:0: TypedDict base classes define key 'x' with incompatible types [invalid_base] +./typeddicts_readonly_inheritance.py:132:0: TypedDict base classes define key 'x' with incompatible requiredness [invalid_base] +""" diff --git a/conformance/results/pycroscope/typeddicts_readonly_kwargs.toml b/conformance/results/pycroscope/typeddicts_readonly_kwargs.toml new file mode 100644 index 00000000..af09a4ab --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_readonly_kwargs.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_readonly_kwargs.py:33:11: Cannot set readonly key 'key1' in TypedDict TypedDict({"key1": Readonly[int], "key2": Readonly[str]}) [readonly_typeddict] +""" diff --git a/conformance/results/pycroscope/typeddicts_readonly_update.toml b/conformance/results/pycroscope/typeddicts_readonly_update.toml new file mode 100644 index 00000000..f7e82a4b --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_readonly_update.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_readonly_update.py:23:0: Cannot set readonly key 'x' in TypedDict TypedDict({"x": Readonly[int], "y": int}) [readonly_typeddict] +""" diff --git a/conformance/results/pycroscope/typeddicts_required.toml b/conformance/results/pycroscope/typeddicts_required.toml new file mode 100644 index 00000000..47bf31ca --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_required.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_required.py:12:7: Unexpected Required annotation [invalid_qualifier] +./typeddicts_required.py:16:7: Unexpected NotRequired annotation [invalid_qualifier] +./typeddicts_required.py:59:16: Required[] cannot be nested [invalid_qualifier] +./typeddicts_required.py:60:7: Required[] and NotRequired[] cannot be nested [invalid_qualifier] +""" diff --git a/conformance/results/pycroscope/typeddicts_type_consistency.toml b/conformance/results/pycroscope/typeddicts_type_consistency.toml new file mode 100644 index 00000000..62d6661c --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_type_consistency.toml @@ -0,0 +1,18 @@ +conformant = "Partial" +notes = """ +Considers TypedDicts to be assignable to plain dict types. +""" +conformance_automated = "Fail" +errors_diff = """ +Line 76: Expected 1 errors +Line 78: Expected 1 errors +Line 82: Expected 1 errors +""" +output = """ +./typeddicts_type_consistency.py:21:0: Incompatible assignment: expected TypedDict({"x": int | None}), got TypedDict({"x": int}) [incompatible_assignment] +./typeddicts_type_consistency.py:38:0: Incompatible assignment: expected TypedDict({"x": NotRequired[int]}), got TypedDict({"x": int}) [incompatible_assignment] +./typeddicts_type_consistency.py:65:0: Incompatible assignment: expected TypedDict({"x": int, "y": int}), got TypedDict({"x": int}) [incompatible_assignment] +./typeddicts_type_consistency.py:69:0: Incompatible assignment: expected TypedDict({"x": int}), got Literal[{'x': 0, 'y': 0}] [incompatible_assignment] +./typeddicts_type_consistency.py:77:0: Incompatible assignment: expected dict[str, object], got TypedDict({"x": int, "y": int}) [incompatible_assignment] +./typeddicts_type_consistency.py:126:0: Incompatible assignment: expected TypedDict({"outer_key": TypedDict({"inner_key": TypedDict({"inner_key": str})})}), got Literal[{'outer_key': {'inner_key': {'inner_key': 1}}}] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/typeddicts_usage.toml b/conformance/results/pycroscope/typeddicts_usage.toml new file mode 100644 index 00000000..0c836ae9 --- /dev/null +++ b/conformance/results/pycroscope/typeddicts_usage.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +./typeddicts_usage.py:23:6: Key 'director' does not exist in TypedDict({"name": str, "year": int}) [invalid_typeddict_key] +./typeddicts_usage.py:24:0: Value for key 'year' must be int, not Literal['1982'] [incompatible_argument] +./typeddicts_usage.py:28:0: Incompatible assignment: expected TypedDict({"name": str, "year": int}), got Literal[{'title': 'Blade Runner', 'year': 1982}] [incompatible_assignment] +./typeddicts_usage.py:35:21: Second argument to "isinstance" cannot be a TypedDict [incompatible_argument] +./typeddicts_usage.py:40:23: TypedDict cannot be used as a TypeVar bound [invalid_annotation] +""" diff --git a/conformance/results/pycroscope/typeforms_typeform.toml b/conformance/results/pycroscope/typeforms_typeform.toml new file mode 100644 index 00000000..01e46a0a --- /dev/null +++ b/conformance/results/pycroscope/typeforms_typeform.toml @@ -0,0 +1,25 @@ +conformant = "Partial" +notes = """ +Fails to reject various weird annotations +""" +conformance_automated = "Fail" +errors_diff = """ +Line 88: Expected 1 errors +""" +output = """ +./typeforms_typeform.py:23:0: Incompatible assignment: expected TypeForm[str | None], got Literal[str | int] [incompatible_assignment] +./typeforms_typeform.py:24:0: Incompatible assignment: expected TypeForm[str | None], got types.GenericAlias (partial from type 'list'[Any[inference] (partial from type 'str' | None)]) [incompatible_assignment] +./typeforms_typeform.py:59:6: Incompatible argument type for x: expected TypeForm[Any[explicit]] but got Literal['not a type'] [incompatible_argument] +./typeforms_typeform.py:67:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal[()] [incompatible_assignment] +./typeforms_typeform.py:68:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal[(1, 2)] [incompatible_assignment] +./typeforms_typeform.py:69:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal[1] [incompatible_assignment] +./typeforms_typeform.py:70:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal[typing.Self] [incompatible_assignment] +./typeforms_typeform.py:71:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal[typing.ClassVar[int]] [incompatible_assignment] +./typeforms_typeform.py:72:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal[typing.Final[int]] [incompatible_assignment] +./typeforms_typeform.py:73:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal[typing.Unpack[Ts]] [incompatible_assignment] +./typeforms_typeform.py:74:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal[typing.Optional] [incompatible_assignment] +./typeforms_typeform.py:75:0: Incompatible assignment: expected TypeForm[Any[explicit]], got Literal['int + str'] [incompatible_assignment] +./typeforms_typeform.py:86:5: Unrecognized annotation type [invalid_annotation] +./typeforms_typeform.py:98:0: Incompatible assignment: expected TypeForm[str], got TypeForm[int] [incompatible_assignment] +./typeforms_typeform.py:108:0: Incompatible assignment: expected TypeForm[str], got type[int] [incompatible_assignment] +""" diff --git a/conformance/results/pycroscope/version.toml b/conformance/results/pycroscope/version.toml new file mode 100644 index 00000000..8060c066 --- /dev/null +++ b/conformance/results/pycroscope/version.toml @@ -0,0 +1 @@ +version = "pycroscope 0.4.0" diff --git a/conformance/results/results.html b/conformance/results/results.html index 1d0c5eaf..3248f3f5 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -180,10 +180,12 @@

Python Type System Conformance Test Results

pyrefly 0.63.1
+
pycroscope 0.4.0
+
ty 0.0.34
- + Type annotations      annotations_coroutines @@ -192,12 +194,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      annotations_forward_refs
Partial

Does not report error for a forward reference that is not enclosed in quotes.

Does not report error for use of quoted type with "|" operator (runtime error).

Incorrectly generates error for quoted type defined in class scope.

Pass
Partial

Incorrectly generates error for quoted type defined in class scope.

Partial

Types in quotes incorrectly refer to shadowing class member.

Does not reject some type forms that require quotes.

+
Partial

Fails to reject "x" | int annotations that fail at runtime.

Rejects some valid quoted annotations.

Partial

Resolves references in type annotations as referring to end-of-scope types (https://discuss.python.org/t/annotation-string-references-in-class-scope-in-conformance-tests/105439, https://github.com/python/typing/pull/2144)

     annotations_generators @@ -206,6 +210,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      annotations_methods
Pass*

Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings.

@@ -213,15 +218,17 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      annotations_typeexpr Pass Pass Pass Pass +
Partial

Fails to reject various weird annotations

Pass - + Type forms      typeforms_typeform @@ -229,9 +236,10 @@

Python Type System Conformance Test Results

Unsupported Pass
Partial

Does not allow assigning a TypeForm to types.GenericAlias.

Does not allow passing a forward reference to a function accepting a TypeForm.

+
Partial

Fails to reject various weird annotations

Unsupported - + Special types in annotations      specialtypes_any @@ -240,12 +248,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      specialtypes_never Pass Pass Pass Pass +
Partial

Does not enforce invariance in some contexts

Does not allow Any to be assigned to Never

Pass      specialtypes_none @@ -254,6 +264,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      specialtypes_promotions Pass @@ -261,15 +272,17 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      specialtypes_type
Partial

Does not treat `type` same as `type[Any]` for assert_type.

Does not allow access to unknown attributes from object of type `type[Any]`.

Pass Pass Pass +Pass
Partial

Allows arbitrary attributes to be accessed on `TA` where `TA = typing.Type[typing.Any]` or `TA = type[typing.Any]`.

Treats `type` equivalently to `type[object]` rather than `type[typing.Any]`.

- + Generics      generics_base_class @@ -278,12 +291,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_basic Pass Pass Pass Pass +Pass
Partial

Incorrectly allows constrained type variables to be solved to a union of their constraints.

     generics_defaults @@ -291,6 +306,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Numerous issues; does not support TypeVarTuple and ParamSpec defaults.

Partial

Does not forbid a `TypeVar` immediately following a `TypeVarTuple` in a parameter list from having a default.

Does not support `TypeVarTuple`.

     generics_defaults_referential @@ -298,6 +314,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Fails to apply default specializations in some cases.

Pass      generics_defaults_specialization @@ -305,6 +322,7 @@

Python Type System Conformance Test Results

Partial

Allows incorrect assignment to type[].

Pass Pass +Pass
Partial

Does not reject subscription of an already-specialized generic class.

     generics_paramspec_basic @@ -313,12 +331,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_paramspec_components Pass Pass Pass Pass +Pass
Partial

Incorrectly allows using `*args: P.args` and `**kwargs: P.kwargs` when `P` has not been put into scope by any other parameter annotation or enclosing scope.

     generics_paramspec_semantics @@ -327,6 +347,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_paramspec_specialization Pass @@ -334,12 +355,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_scoping Pass Pass Pass
Partial

Does not implement several scoping checks/restrictions for generics

+Pass
Partial

Does not reject `list[T]()` in the global scope, where `T` is an unbound type variable.

Does nto reject `alias: TypeAlias = list[T]` in the body scope of a class generic over a type variable `T`.

     generics_self_advanced @@ -348,6 +371,7 @@

Python Type System Conformance Test Results

Pass
Pass*

Treats attributes not initialized on the class as instance-only

Pass +Pass      generics_self_attributes Pass @@ -355,6 +379,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_self_basic Pass @@ -362,6 +387,7 @@

Python Type System Conformance Test Results

Pass
Partial

Return annotation of Self allows returning the concrete instance of the current class.

Pass +Pass      generics_self_protocols Pass @@ -369,12 +395,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_self_usage Pass Pass Pass
Partial

Does not implement some restrictions on where Self can be used

+Pass
Partial

Does not reject `Self` used in a return annotation when `self` is annotated using another type variable.

     generics_syntax_compatibility @@ -382,6 +410,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass Unsupported      generics_syntax_declarations @@ -390,6 +419,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_syntax_infer_variance
Unsupported

Type parameter syntax not yet supported.

@@ -397,12 +427,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_syntax_scoping
Partial

Does not following runtime scoping rules for type parameters in all cases.

Pass Pass Pass +
Partial

Misses some details of scoping rules.

Pass      generics_type_erasure @@ -410,6 +442,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Partial

Does not reject access of generic instance variable from the class object.

     generics_typevartuple_args @@ -417,6 +450,7 @@

Python Type System Conformance Test Results

Partial

Does not correctly solve TypeVarTuple with heterogeneous bounds.

Pass Pass +Pass
Partial

Supports PEP-646 unpacked tuples but not TypeVarTuple.

     generics_typevartuple_basic @@ -424,6 +458,7 @@

Python Type System Conformance Test Results

Partial

Does not correctly solve TypeVarTuple with heterogeneous bounds.

Pass Pass +Pass Unsupported      generics_typevartuple_callable @@ -431,6 +466,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass Unsupported      generics_typevartuple_concat @@ -438,6 +474,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass Unsupported      generics_typevartuple_overloads @@ -446,12 +483,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_typevartuple_specialization
Partial

Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

Pass Pass Pass +Pass Unsupported      generics_typevartuple_unpack @@ -459,6 +498,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass Unsupported      generics_upper_bound @@ -467,12 +507,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      generics_variance
Partial

Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

Pass Pass Pass +Pass Unsupported      generics_variance_inference @@ -481,8 +523,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Type qualifiers      qualifiers_annotated @@ -490,6 +533,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Fails to reject various weird annotations.

False positive on lambda in Annotated.

Pass      qualifiers_final_annotation @@ -498,6 +542,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      qualifiers_final_decorator Pass @@ -505,8 +550,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Class type compatibility      classes_classvar @@ -515,6 +561,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      classes_override Pass @@ -522,8 +569,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Type aliases      aliases_explicit @@ -531,6 +579,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Partial

Does not emit a diagnostic if a type alias to a union, in which every element of the union is implicitly specialized with `Unknown`, is invalidly specialized again.

     aliases_implicit @@ -538,6 +587,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Does not reject invalid syntax in implicit type aliases.

+
Partial

Fails to handle various weird annotations.

Various bugs with resolving generic aliases.

Partial

Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases.

Falls short on full syntactic validation of type aliases.

     aliases_newtype @@ -546,12 +596,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      aliases_recursive Pass Pass Pass Pass +Pass Unsupported      aliases_type_statement @@ -559,6 +611,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Fails to reject various weird annotations.

Partial

Does not reject circular definitions of type aliases.

Does not support `type` statements generic over `TypeVarTuple`s.

     aliases_typealiastype @@ -566,6 +619,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Rejects valid ParamSpec specialization.

Partial

Does not reject specializing a type parameter in a generic type alias with a type inconsistent with the parameter's upper bound.

Does not reject declaring a type alias with a type variable that is not in scope.

Does not reject declaring a type alias with a non-literal tuple passed to the `type_params` parameter.

Does not reject cyclically defined type aliases.

     aliases_variance @@ -573,9 +627,10 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass Unsupported - + Literals      literals_interactions @@ -583,6 +638,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Pass*

Deliberately does not allow `str` to be narrowed to literal string types through equality or containment checks due to the possibility of `str` subclasses that could have unexpected equality semantics.

     literals_literalstring @@ -591,12 +647,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      literals_parameterizations
Partial

Does not reject tuple within Literal.

Pass Pass Pass +
Partial

Fails to reject various invalid literal parameterizations.

Pass      literals_semantics @@ -605,8 +663,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Protocols      protocols_class_objects @@ -614,6 +673,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Abstract type[Proto] still allows protocol class objects in some paths.

Unsupported

`type[Proto]` is not yet supported.

`ClassVar` protocol members are not yet supported.

`@property` protocol members are only partially supported.

A class object `C` is only considered to inhabit a protocol type with a method member `f` if `f` exists as an attribute on the metaclass of `C`.

     protocols_definition @@ -621,6 +681,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Partial

Does not reject implicit instance attributes in `Protocol` methods.

Does not support `ClassVar` protocol members.

Incorrectly considers `ClassVar` attributes on concrete classes as satisfying non-`ClassVar` attribute members on protocols.

Only has partial support for `@property` protocol members.

     protocols_explicit @@ -628,6 +689,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Unsupported

Allows implicitly abstract protocol methods to be called via `super()` on a protocol subclass.

Allows instantiation of abstract subclasses of protocol classes.

     protocols_generic @@ -635,6 +697,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Fails to reject duplicate generic/protocol bases.

Treats global object as a literal.

Partial

Only partially supports `@property` protocol members.

     protocols_merging @@ -642,6 +705,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Partial

Does not reject attempted instantiation of abstract subclasses of protocols.

     protocols_modules @@ -649,6 +713,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Partial

Never considers a module as satisfying a protocol with a method member due to the fact that the method will never exist on the class `types.ModuleType`, only on a given specific module instance.

     protocols_recursive @@ -656,6 +721,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Partial

Fails to solve a type variable involving a recursive generic protocol.

     protocols_runtime_checkable @@ -663,6 +729,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Partial

Does not reject `isinstance()` or `issubclass()` calls against runtime-checkable protocols where there is an unsafe overlap between the type of the first argument and the protocol.

     protocols_self @@ -671,6 +738,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      protocols_subtyping Pass @@ -678,15 +746,17 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      protocols_variance Pass Pass Pass Pass +Pass Unsupported - + Callables      callables_annotation @@ -694,6 +764,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Parameter names are lost when resolving ParamSpec

+Pass
Partial

Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.

     callables_kwargs @@ -702,6 +773,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      callables_protocol Pass @@ -709,6 +781,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      callables_subtyping Pass @@ -716,8 +789,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Constructors      constructors_call_init @@ -725,6 +799,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass
Partial

Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass.

Does not reject class-scoped type variables used in the `self` annotation.

     constructors_call_metaclass @@ -733,6 +808,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      constructors_call_new
Partial

Does not support __new__ return type that is not a subclass of the class being constructed.

Does not skip evaluation of __init__ based on __new__ return type.

Does not report errors during binding to cls parameter of __new__ method.

@@ -740,12 +816,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      constructors_call_type
Partial

Does not validate call to custom metaclass __call__ method through type[T].

Pass Pass Pass +Pass
Partial

Has overly lenient handling of calls to `type[T]` if `T` is a type variable without an upper bound.

     constructors_callable @@ -753,6 +831,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Converting constructor to callable does not preserve class-scoped type params.

Converting constructor to callable does not substitute Self in __new__

Converting constructor to callable uses __new__ signature instead of __init__

+Pass
Partial

Does not include `__init__` when `__new__` returns `Self`.

Does not respect `NoReturn` return type on metaclass `__call__`.

Does not ignore `__init__` when `__new__` returns `Any`.

Unions overload return types.

     constructors_consistency @@ -761,8 +840,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Overloads      overloads_basic @@ -770,6 +850,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Does less literal promotion than the test asks for.

Pass      overloads_consistency @@ -777,6 +858,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass Unsupported      overloads_definitions @@ -785,12 +867,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      overloads_definitions_stub
Partial

Allows @override to appear in a stub file not on the first overload.

Pass Pass Pass +
Unsupported

Does not support checking stubs.

Pass      overloads_evaluation @@ -799,8 +883,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Exceptions      exceptions_context_managers @@ -808,9 +893,10 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Some error suppressing context managers are not detected

+Pass Unsupported - + Dataclasses      dataclasses_descriptors @@ -818,6 +904,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

* Assumes descriptor behavior only when field is assigned in class body

* Doesn't allow non-data descriptors or data descriptors with differing `__get__` and `__set__` types

+
Partial

Conformance suite is questionable; see https://github.com/python/typing/issues/2259

Partial

Only infers a descriptor `__get__` method as being called when a descriptor attribute is accessed on an instance if the descriptor attribute is present in the class namespace.

     dataclasses_final @@ -826,6 +913,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_frozen Pass @@ -833,12 +921,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_hash
Unsupported

Does not synthesize `__hash__ = None` as a class attribute for unhashable dataclasses.

Does not report when an unhashable dataclass has `__hash__` called directly on an instance.

Does not report when dataclass is not compatible with Hashable protocol.

Pass Pass Pass +Pass
Partial

Understands the `Hashable` protocol as equivalent to `object`.

     dataclasses_inheritance @@ -847,6 +937,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_kwonly Pass @@ -854,6 +945,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_match_args Pass @@ -861,6 +953,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_order Pass @@ -868,6 +961,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_postinit Pass @@ -875,12 +969,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_slots
Partial

Does not reject write to instance variable that is not defined in __slots__.

Pass Pass Pass +Pass
Partial

Synthesizes a `__slots__` attribute but does not validate attribute assignments against `__slots__`.

     dataclasses_transform_class @@ -889,12 +985,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_transform_converter
Unsupported

Converter parameter not yet supported.

Pass Pass Pass +Pass
Partial

Does not pass all assertions in the test file, due to limitations in ty's generics solver.

Incorrectly rejects a converter of `dict` combined with a default of `()`.

Incorrectly rejects passing a sequence of two-element string tuples to the `dict` constructor.

     dataclasses_transform_field @@ -903,6 +1001,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_transform_func
Partial

Does not handle `kw_only=False` override when `kw_only_default=True`.

Does not report error when `order=False` and comparison operators are used.

@@ -910,6 +1009,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_transform_meta Pass @@ -917,6 +1017,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      dataclasses_usage
Pass*

Does not detect unannotated usage of `dataclasses.field()`.

@@ -924,8 +1025,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Typed dictionaries      typeddicts_alt_syntax @@ -934,6 +1036,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_class_syntax Pass @@ -941,12 +1044,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_extra_items
Unsupported

Not supported.

Pass Pass Pass +Pass Unsupported      typeddicts_final @@ -955,6 +1060,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_inheritance Pass @@ -962,6 +1068,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_operations Pass @@ -969,6 +1076,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_readonly Pass @@ -976,6 +1084,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_readonly_consistency Pass @@ -983,6 +1092,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_readonly_inheritance
Partial

Incorrectly rejects non-ReadOnly override of ReadOnly item.

Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

@@ -990,6 +1100,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_readonly_kwargs Pass @@ -997,6 +1108,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_readonly_update
Partial

Incorrectly allows update of ReadOnly item.

Incorrectly rejects update involving an item with Never type.

@@ -1004,6 +1116,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_required Pass @@ -1011,12 +1124,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      typeddicts_type_consistency Pass Pass Pass Pass +
Partial

Considers TypedDicts to be assignable to plain dict types.

Pass      typeddicts_usage @@ -1025,8 +1140,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Tuples      tuples_type_compat @@ -1035,6 +1151,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      tuples_type_form Pass @@ -1042,6 +1159,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      tuples_unpacked
Partial

"More than one unpack" error is missing in some cases.

@@ -1049,8 +1167,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Named tuples      namedtuples_define_class @@ -1058,6 +1177,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +
Partial

Does not support precise type inference for slices over namedtuples.

Pass      namedtuples_define_functional @@ -1066,6 +1186,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      namedtuples_type_compat Pass @@ -1073,6 +1194,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      namedtuples_usage
Partial

Does not reject attempt to delete named tuple field by name.

@@ -1080,8 +1202,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Enumerations      enums_behaviors @@ -1090,6 +1213,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      enums_definition Pass @@ -1097,12 +1221,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      enums_expansion
Partial

Improperly applies narrowing to Flag subclass.

Pass Pass Pass +Pass
Partial

Does not support `enum.Flag`.

     enums_member_names @@ -1111,6 +1237,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      enums_member_values
Partial

Does not enforce declared type of `_value_`.

Does not enforce assigned tuple types for enum members (optional).

@@ -1118,6 +1245,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      enums_members
Partial

Does not treat attribute with annotation and no assignment as non-member.

Does not treat callables as non-members.

Does not honor `enum.member` as method decorator.

Does not properly handle aliased enum members.

Does not support `_ignore_` mechanism (optional).

Does not treat attributes with private names as non-members.

@@ -1125,8 +1253,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Type narrowing      narrowing_typeguard @@ -1135,15 +1264,17 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      narrowing_typeis Pass Pass Pass Pass +Pass
Partial

Intersects the pre-existing type with the top materialization of the bracketed type rather than the bracketed type itself.

- + Type checker directives      directives_assert_type @@ -1152,6 +1283,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_cast Pass @@ -1159,12 +1291,14 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_deprecated Pass Pass Pass Pass +Pass
Partial

Does not detect calls to deprecated overloads.

Does not detect implicit calls to deprecated dunder methods, for example via operators.

Does not detect accesses of, or attempts to set, deprecated properties.

     directives_disjoint_base @@ -1172,6 +1306,7 @@

Python Type System Conformance Test Results

Unsupported

Does not support PEP 800 disjoint-base semantics.

Pass
Unsupported

Does not support PEP 800 disjoint-base semantics.

+
Partial

Does not reject invalid class definitions due to disjoint bases, but uses disjoint base information in type narrowing.

Pass      directives_no_type_check @@ -1180,6 +1315,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_reveal_type Pass @@ -1187,6 +1323,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_type_checking Pass @@ -1194,6 +1331,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_type_ignore
Partial

Does not honor "# type: ignore" comment if comment includes additional text.

@@ -1201,6 +1339,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_type_ignore_file1 Pass @@ -1208,6 +1347,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_type_ignore_file2 Pass @@ -1215,6 +1355,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_version_platform
Pass*

Does not understand three-element form of sys.version checks.

Does not understand os.name checks.

@@ -1222,8 +1363,9 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass - + Historical and deprecated features      historical_positional @@ -1232,6 +1374,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass diff --git a/conformance/scripts/bump_type_checkers.py b/conformance/scripts/bump_type_checkers.py index fdf859b7..195b1966 100755 --- a/conformance/scripts/bump_type_checkers.py +++ b/conformance/scripts/bump_type_checkers.py @@ -7,7 +7,7 @@ from subprocess import CalledProcessError, run -TYPE_CHECKERS = ("mypy", "pyright", "zuban", "pyrefly", "ty") +TYPE_CHECKERS = ("mypy", "pyright", "zuban", "pyrefly", "ty", "pycroscope") def main() -> int: diff --git a/conformance/src/main.py b/conformance/src/main.py index 62a827bc..005b3bd9 100644 --- a/conformance/src/main.py +++ b/conformance/src/main.py @@ -17,11 +17,15 @@ from test_groups import get_test_cases, get_test_groups from type_checker import TYPE_CHECKERS, TypeChecker +FULL_OUTPUT_KEY = "__full_output__" + def run_tests( root_dir: Path, type_checker: TypeChecker, test_cases: Sequence[Path], + *, + verbose: bool = False, ): print(f"Running tests for {type_checker.name}") @@ -30,8 +34,23 @@ def run_tests( test_duration = time() - test_start_time print(f"Completed tests for {type_checker.name} in {test_duration:.2f} seconds") + if verbose: + print(f"Verbose output for {type_checker.name}:") + full_output = tests_output.get(FULL_OUTPUT_KEY) + if full_output: + print("===== raw =====") + print(full_output, end="" if full_output.endswith("\n") else "\n") + else: + for test_name in sorted(tests_output): + print(f"===== {test_name} =====") + output = tests_output[test_name] + if output: + print(output, end="" if output.endswith("\n") else "\n") + print("") - for _, output in tests_output.items(): + for test_name, output in tests_output.items(): + if test_name.startswith("__"): + continue type_checker.parse_errors(output.splitlines()) results_dir = root_dir / "results" / type_checker.name @@ -265,7 +284,7 @@ def main(): if not type_checker.install(): print(f"Skipping tests for {type_checker.name}") else: - run_tests(root_dir, type_checker, test_cases) + run_tests(root_dir, type_checker, test_cases, verbose=options.verbose) # Generate a summary report. generate_summary(root_dir) diff --git a/conformance/src/options.py b/conformance/src/options.py index 76c2c5be..85467277 100644 --- a/conformance/src/options.py +++ b/conformance/src/options.py @@ -9,8 +9,9 @@ @dataclass class _Options: - report_only: bool | None + report_only: bool only_run: str | None + verbose: bool def parse_options(argv: list[str]) -> _Options: @@ -24,7 +25,12 @@ def parse_options(argv: list[str]) -> _Options: reporting_group.add_argument( "--only-run", help="Only runs the type checker", - choices=[tc.name for tc in TYPE_CHECKERS] + choices=[tc.name for tc in TYPE_CHECKERS], + ) + parser.add_argument( + "--verbose", + action="store_true", + help="print full output from the type checker", ) ret = _Options(**vars(parser.parse_args(argv))) return ret diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 6187b8b3..c7f28b5c 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -3,14 +3,18 @@ """ import json +import os +from pathlib import Path import re import shutil import sys +import sysconfig from abc import ABC, abstractmethod -from pathlib import Path from subprocess import PIPE, CalledProcessError, run from typing import Sequence +CONFORMANCE_ROOT = Path(__file__).resolve().parent.parent + class TypeChecker(ABC): @property @@ -383,10 +387,119 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: return line_to_errors +class PycroscopeTypeChecker(TypeChecker): + @property + def name(self) -> str: + return "pycroscope" + + def install(self) -> bool: + try: + self.get_version() + return True + except (CalledProcessError, FileNotFoundError): + print( + "Unable to run pycroscope. Install conformance dependencies with " + "'uv sync --frozen' from the conformance directory." + ) + return False + + def get_version(self) -> str: + proc = run([self._command(), "--version"], stdout=PIPE, text=True, check=True) + return proc.stdout.strip() + + @staticmethod + def _command() -> str: + executable = "pycroscope.exe" if sys.platform == "win32" else "pycroscope" + return str(Path(sysconfig.get_path("scripts")) / executable) + + @staticmethod + def _normalize_output_line(line: str) -> str: + line = line.replace(str(CONFORMANCE_ROOT), "...") + line = re.sub(r"", r"", line) + # Pycroscope can include object reprs with process-specific addresses + # (e.g. "... at 0x10abc1234>"). Normalize these for stable snapshots. + return re.sub(r"0x[0-9a-fA-F]+", "0x...", line) + + def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: + command = [ + self._command(), + ".", + "--output-format", + "concise", + "--disable", + "import_failed", + "--disable", + "unused_variable", + "--disable", + "unused_assignment", + "--disable", + "must_use", + "--enable", + "invalid_literal", + "--enable", + "incompatible_override", + "--enable", + "classvar_type_parameters", + ] + proc = run( + command, + stdout=PIPE, + stderr=PIPE, + text=True, + encoding="utf-8", + env={**os.environ, "PYTHONPATH": "."}, + ) + lines = proc.stderr.splitlines() + full_output_lines: list[str] = [] + + # Collect results per file and sort for deterministic output. + sortable_results: dict[str, list[tuple[int, str, str]]] = {} + for line in lines: + if not line.strip(): + continue + line = self._normalize_output_line(line) + full_output_lines.append(line) + # Concise output line format: + # file.py:12:3: Message text [error_code] + match = re.match(r"^(.+?):(\d+)(?::\d+)?:\s(.*)$", line) + if not match: + continue + file_name = Path(match.group(1)).name + lineno = int(match.group(2)) + message = match.group(3) + sortable_results.setdefault(file_name, []).append((lineno, message, line)) + + results_dict: dict[str, str] = {} + for file_name, entries in sortable_results.items(): + entries.sort(key=lambda item: (item[0], item[1])) + results_dict[file_name] = "".join(f"{line}\n" for _, _, line in entries) + if full_output_lines: + results_dict["__full_output__"] = "".join( + f"{line}\n" for line in full_output_lines + ) + return results_dict + + def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: + line_to_errors: dict[int, list[str]] = {} + for line in output: + if not line.strip(): + continue + line = self._normalize_output_line(line) + # reveal_type diagnostics are informational for conformance purposes. + if "[reveal_type]" in line or "Revealed type is " in line: + continue + match = re.match(r"^.+?:(\d+)(?::\d+)?:\s", line) + if not match: + continue + line_to_errors.setdefault(int(match.group(1)), []).append(line) + return line_to_errors + + TYPE_CHECKERS: Sequence[TypeChecker] = ( MypyTypeChecker(), PyrightTypeChecker(), ZubanLSTypeChecker(), PyreflyTypeChecker(), + PycroscopeTypeChecker(), TyTypeChecker(), ) diff --git a/conformance/uv.lock b/conformance/uv.lock index d23fb357..8b926b99 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -2,6 +2,15 @@ version = 1 revision = 3 requires-python = "==3.12.*" +[[package]] +name = "importlib-resources" +version = "7.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e4/06/b56dfa750b44e86157093bc8fca0ab81dccbf5260510de4eaf1cb69b5b99/importlib_resources-7.1.0.tar.gz", hash = "sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708", size = 44985, upload-time = "2026-04-12T16:36:09.232Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/db/55a262f3606bebcae07cc14095338471ad7c0bbcaa37707e6f0ee49725b7/importlib_resources-7.1.0-py3-none-any.whl", hash = "sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1", size = 37232, upload-time = "2026-04-12T16:36:08.219Z" }, +] + [[package]] name = "librt" version = "0.8.1" @@ -72,6 +81,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ef/3c/2c197d226f9ea224a9ab8d197933f9da0ae0aac5b6e0f884e2b8d9c8e9f7/pathspec-1.0.4-py3-none-any.whl", hash = "sha256:fb6ae2fd4e7c921a165808a552060e722767cfa526f99ca5156ed2ce45a5c723", size = 55206, upload-time = "2026-01-27T03:59:45.137Z" }, ] +[[package]] +name = "pycroscope" +version = "0.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typeshed-client" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7c/8e/284fdc4027bf9a7c92f8256ff07006a50456ccd2ce5506d040e6ed2f2f1b/pycroscope-0.4.0.tar.gz", hash = "sha256:14b40e36f6186dd2eff712c8da91d02eb89a263a257472b49f4c59153ff380fb", size = 662901, upload-time = "2026-05-02T14:00:43.775Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/50/5f/c172c08b69e29d4094e1466b63260d8daf61a3ed3c689de7936f952f1663/pycroscope-0.4.0-py3-none-any.whl", hash = "sha256:cb7440b44ed16ed927995c33867cab22503f4bff7efe504964b81fb967183223", size = 714256, upload-time = "2026-05-02T14:00:41.891Z" }, +] + [[package]] name = "pyrefly" version = "0.63.1" @@ -153,12 +175,26 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/63/8f/bf041a06260d77662c0605e56dacfe90b786bf824cbe1aed238d15fe5e84/ty-0.0.34-py3-none-win_arm64.whl", hash = "sha256:ea09108cbcb16b6b06d7596312b433bf49681e78d30e4dc7fb3c1b248a95e09a", size = 10846945, upload-time = "2026-05-01T23:06:44.428Z" }, ] +[[package]] +name = "typeshed-client" +version = "2.11.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "importlib-resources" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/85/7d/62fbae352d5fb7ce5ef4d9ca73bf7a9b02b790d2524ab6ef1e0e799a5d1b/typeshed_client-2.11.0.tar.gz", hash = "sha256:0b8f2ab88f611f5e97b70d2a8123942d3d7d5c74cee8ae694db83422f32f9481", size = 522774, upload-time = "2026-05-01T14:51:52.38Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4f/22/fa16b462157bd869dfad528f5637506b9430ca63d48fb536ecf4cc78481a/typeshed_client-2.11.0-py3-none-any.whl", hash = "sha256:5745e0990b80b29a286b22d68f81779c5c7adf1cac8969eeafba44b73b486c36", size = 787609, upload-time = "2026-05-01T14:51:51.005Z" }, +] + [[package]] name = "typing-conformance" version = "0.1.0" source = { virtual = "." } dependencies = [ { name = "mypy" }, + { name = "pycroscope" }, { name = "pyrefly" }, { name = "pyright" }, { name = "tomli" }, @@ -170,6 +206,7 @@ dependencies = [ [package.metadata] requires-dist = [ { name = "mypy" }, + { name = "pycroscope" }, { name = "pyrefly" }, { name = "pyright" }, { name = "tomli" },