Skip to content

Commit c8b2a34

Browse files
committed
update results for the latest ty version and the new conformance infrastructure
1 parent 159e38a commit c8b2a34

39 files changed

+191
-238
lines changed

conformance/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies = [
99
"tomli",
1010
"tomlkit",
1111
"zuban",
12+
"ty",
1213
]
1314

1415
[tool.uv]

conformance/results/results.html

Lines changed: 31 additions & 31 deletions
Large diffs are not rendered by default.

conformance/results/ty/aliases_implicit.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments
2020
aliases_implicit.py:79:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2
2121
aliases_implicit.py:80:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...`
2222
aliases_implicit.py:81:25: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int | float` of type variable `TFloat@GoodTypeAlias12`
23-
aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[Unknown | <class 'int'> | <class 'str'>]` is not allowed in a type expression
23+
aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[<class 'int'> | <class 'str'>]` is not allowed in a type expression
2424
aliases_implicit.py:108:9: error[invalid-type-form] Variable of type `tuple[tuple[<class 'int'>, <class 'str'>]]` is not allowed in a type expression
25-
aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[Unknown | <class 'int'>]` is not allowed in a type expression
26-
aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[Unknown | str, Unknown | str]` is not allowed in a type expression
25+
aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[<class 'int'>]` is not allowed in a type expression
26+
aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[str, str]` is not allowed in a type expression
2727
aliases_implicit.py:114:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression
2828
aliases_implicit.py:115:10: error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a type expression
2929
aliases_implicit.py:116:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression

conformance/results/ty/aliases_type_statement.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@ conformance_automated = "Fail"
22
conformant = "Partial"
33
notes = """
44
Does not reject use of the `type` statement inside functions.
5-
Does not reject attempts to use legacy type variables in new-tyle type aliases.
65
Does not reject circular definitions of type aliases.
76
Does not reject redeclarations of type aliases.
87
Does not support `type` statements generic over `TypeVarTuple`s.
98
"""
109
errors_diff = """
1110
Line 56: Expected 1 errors
12-
Line 62: Expected 1 errors
13-
Line 67: Expected 1 errors
1411
Line 84: Expected 1 errors
1512
Lines 51, 52: Expected error (tag 'TA14')
16-
Line 10: Unexpected errors ['aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3']
13+
Line 10: Unexpected errors ['aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3', 'aliases_type_statement.py:10:52: error[invalid-type-form] `...` is not allowed in this context in a type expression']
1714
"""
1815
output = """
1916
aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3
17+
aliases_type_statement.py:10:52: error[invalid-type-form] `...` is not allowed in this context in a type expression
2018
aliases_type_statement.py:17:1: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `bit_count`
2119
aliases_type_statement.py:19:1: error[call-non-callable] Object of type `TypeAliasType` is not callable
2220
aliases_type_statement.py:23:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib`
@@ -29,14 +27,16 @@ aliases_type_statement.py:39:23: error[invalid-type-form] Tuple literals are not
2927
aliases_type_statement.py:40:22: error[invalid-type-form] List comprehensions are not allowed in type expressions
3028
aliases_type_statement.py:41:22: error[invalid-type-form] Dict literals are not allowed in type expressions
3129
aliases_type_statement.py:42:22: error[invalid-type-form] Function calls are not allowed in type expressions
32-
aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | <class 'int'>]` in type expression
30+
aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[<class 'int'>]` in type expression
3331
aliases_type_statement.py:43:28: error[invalid-type-form] Int literals are not allowed in this context in a type expression
3432
aliases_type_statement.py:44:22: error[invalid-type-form] `if` expressions are not allowed in type expressions
3533
aliases_type_statement.py:45:22: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression
3634
aliases_type_statement.py:46:23: error[invalid-type-form] Boolean literals are not allowed in this context in a type expression
3735
aliases_type_statement.py:47:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression
3836
aliases_type_statement.py:48:23: error[invalid-type-form] Boolean operations are not allowed in type expressions
3937
aliases_type_statement.py:49:23: error[fstring-type-annotation] Type expressions cannot use f-strings
38+
aliases_type_statement.py:62:23: error[unbound-type-variable] Type variable `V` is not bound to any outer generic context
39+
aliases_type_statement.py:67:17: error[unbound-type-variable] Type variable `T1` is not bound to any outer generic context
4040
aliases_type_statement.py:77:27: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2`
4141
aliases_type_statement.py:79:32: error[invalid-type-arguments] Type `int` is not assignable to upper bound `str` of type variable `T@RecursiveTypeAlias2`
4242
aliases_type_statement.py:82:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias3`

conformance/results/ty/aliases_typealiastype.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ aliases_typealiastype.py:54:43: error[invalid-type-form] Tuple literals are not
2424
aliases_typealiastype.py:55:42: error[invalid-type-form] List comprehensions are not allowed in type expressions
2525
aliases_typealiastype.py:56:42: error[invalid-type-form] Dict literals are not allowed in type expressions
2626
aliases_typealiastype.py:57:42: error[invalid-type-form] Function calls are not allowed in type expressions
27-
aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | <class 'int'>]` in type expression
27+
aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[<class 'int'>]` in type expression
2828
aliases_typealiastype.py:58:48: error[invalid-type-form] Int literals are not allowed in this context in a type expression
2929
aliases_typealiastype.py:59:42: error[invalid-type-form] `if` expressions are not allowed in type expressions
3030
aliases_typealiastype.py:60:42: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression

conformance/results/ty/annotations_forward_refs.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ conformance_automated = "Fail"
22
conformant = "Partial"
33
notes = """
44
Does not detect runtime errors from partially stringified PEP-604 unions.
5-
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)
5+
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)
66
"""
77
errors_diff = """
88
Line 24: Expected 1 errors
@@ -21,7 +21,7 @@ annotations_forward_refs.py:43:10: error[invalid-type-form] Tuple literals are n
2121
annotations_forward_refs.py:44:10: error[invalid-type-form] List comprehensions are not allowed in type expressions
2222
annotations_forward_refs.py:45:10: error[invalid-type-form] Dict literals are not allowed in type expressions
2323
annotations_forward_refs.py:46:10: error[invalid-type-form] Function calls are not allowed in type expressions
24-
annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | <class 'int'>]` in type expression
24+
annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[<class 'int'>]` in type expression
2525
annotations_forward_refs.py:47:16: error[invalid-type-form] Int literals are not allowed in this context in a type expression
2626
annotations_forward_refs.py:48:10: error[invalid-type-form] `if` expressions are not allowed in type expressions
2727
annotations_forward_refs.py:49:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression

conformance/results/ty/annotations_typeexpr.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ annotations_typeexpr.py:90:9: error[invalid-type-form] Tuple literals are not al
88
annotations_typeexpr.py:91:9: error[invalid-type-form] List comprehensions are not allowed in type expressions
99
annotations_typeexpr.py:92:9: error[invalid-type-form] Dict literals are not allowed in type expressions
1010
annotations_typeexpr.py:93:9: error[invalid-type-form] Function calls are not allowed in type expressions
11-
annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | <class 'int'>]` in type expression
11+
annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[<class 'int'>]` in type expression
1212
annotations_typeexpr.py:94:15: error[invalid-type-form] Int literals are not allowed in this context in a type expression
1313
annotations_typeexpr.py:95:9: error[invalid-type-form] `if` expressions are not allowed in type expressions
1414
annotations_typeexpr.py:96:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression

conformance/results/ty/callables_annotation.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
conformance_automated = "Fail"
22
conformant = "Partial"
33
notes = """
4-
Does not reject `Callable[[...], int]` in a type expression.
54
Does not support `Concatenate`.
65
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`.
76
Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`.
87
"""
98
errors_diff = """
10-
Line 59: Expected 1 errors
119
Line 91: Expected 1 errors
1210
Line 93: Expected 1 errors
1311
Line 159: Expected 1 errors
@@ -30,5 +28,6 @@ callables_annotation.py:56:14: error[invalid-type-form] The first argument to `C
3028
callables_annotation.py:57:18: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[int]`?
3129
callables_annotation.py:58:5: error[invalid-type-form] Special form `typing.Callable` expected exactly two arguments (parameter types and return type)
3230
callables_annotation.py:58:14: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...`
31+
callables_annotation.py:59:14: error[invalid-type-form] `[...]` is not a valid parameter list for `Callable`: Did you mean `Callable[..., int]`?
3332
callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6`
3433
"""

conformance/results/ty/callables_subtyping.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
conformance_automated = "Fail"
2-
conformant = "Partial"
3-
notes = """
4-
Does not reject assigning a callable with a single variadic positional parameter to a variable declared with a `Callable` type that accepts certain specific keyword arguments.
5-
"""
1+
conformance_automated = "Pass"
62
errors_diff = """
7-
Line 125: Expected 1 errors
83
"""
94
output = """
105
callables_subtyping.py:26:36: error[invalid-assignment] Object of type `(int, /) -> int` is not assignable to `(int | float, /) -> int | float`
@@ -21,6 +16,7 @@ callables_subtyping.py:119:23: error[invalid-assignment] Object of type `StrArgs
2116
callables_subtyping.py:120:23: error[invalid-assignment] Object of type `IntArgs4` is not assignable to `IntStrArgs4`
2217
callables_subtyping.py:122:20: error[invalid-assignment] Object of type `IntArgs4` is not assignable to `StrArgs4`
2318
callables_subtyping.py:124:20: error[invalid-assignment] Object of type `StrArgs4` is not assignable to `IntArgs4`
19+
callables_subtyping.py:125:22: error[invalid-assignment] Object of type `IntStrArgs4` is not assignable to `Standard4`
2420
callables_subtyping.py:126:22: error[invalid-assignment] Object of type `StrArgs4` is not assignable to `Standard4`
2521
callables_subtyping.py:151:22: error[invalid-assignment] Object of type `NoKwargs5` is not assignable to `IntKwargs5`
2622
callables_subtyping.py:154:24: error[invalid-assignment] Object of type `NoKwargs5` is not assignable to `FloatKwargs5`

conformance/results/ty/constructors_callable.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@ errors_diff = """
44
Line 66: Expected 1 errors
55
Line 67: Expected 1 errors
66
Line 68: Expected 1 errors
7-
Line 186: Expected 1 errors
8-
Line 197: Expected 1 errors
97
Line 102: Unexpected errors ['constructors_callable.py:102:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`']
108
Line 107: Unexpected errors ['constructors_callable.py:107:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`']
119
Line 143: Unexpected errors ["constructors_callable.py:143:27: error[invalid-argument-type] Argument to function `accepts_callable` is incorrect: Expected `() -> Any | Class6Any`, found `<class 'Class6Any'>`"]
1210
Line 145: Unexpected errors ['constructors_callable.py:145:1: error[type-assertion-failure] Type `Any | Class6Any` does not match asserted type `Any`']
1311
Line 166: Unexpected errors ['constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]`']
1412
Line 167: Unexpected errors ['constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]`']
15-
Line 185: Unexpected errors ['constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]`']
1613
"""
1714
output = """
1815
constructors_callable.py:36:13: info[revealed-type] Revealed type: `(x: int) -> Class1`
@@ -39,6 +36,9 @@ constructors_callable.py:164:5: info[revealed-type] Revealed type: `Overload[[T]
3936
constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]`
4037
constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]`
4138
constructors_callable.py:184:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class8[T]`
42-
constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]`
39+
constructors_callable.py:186:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]`
40+
constructors_callable.py:186:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]`
4341
constructors_callable.py:195:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class9`
42+
constructors_callable.py:197:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]`
43+
constructors_callable.py:197:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]`
4444
"""

0 commit comments

Comments
 (0)