Skip to content

Commit f832313

Browse files
committed
Merge branch 'main' into yangdanny97-namedtuple
2 parents b8b0acb + c16b1df commit f832313

File tree

510 files changed

+6945
-4454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

510 files changed

+6945
-4454
lines changed

.github/workflows/build-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
- name: Set up Python
18-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@v6
1919
with:
2020
python-version: 3.9
2121
- name: Install dependencies

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v5
1818
- name: Set up Python 3
19-
uses: actions/setup-python@v5
19+
uses: actions/setup-python@v6
2020
with:
2121
python-version: 3
2222
cache: "pip"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repository.
1414
For conversations that are more suitable to a chat platform, you can use one of the following:
1515

1616
- [gitter](https://gitter.im/python/typing)
17-
- [discord](https://discord.com/channels/267624335836053506/891788761371906108) `#type-hinting` channel
17+
- [discord](https://discord.com/invite/python) [#type-hinting](https://discord.com/channels/267624335836053506/891788761371906108) channel
1818

1919
## Repository Content
2020

conformance/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ MANIFEST
3232

3333
# Tools
3434
.mypy_cache
35-
.pyre_configuration
36-
.pyre
3735
.coverage
3836
htmlcov
3937

conformance/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,12 @@ To run the conformance test suite:
7575
* Switch to the `src` subdirectory and run `python main.py`.
7676

7777
Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker.
78-
Currently, the only unsupported type checker is Pyre on Windows.
7978

8079
## Reporting Conformance Results
8180

8281
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.
8382

84-
Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyre, and pyright. It is the goal and desire to add additional type checkers over time.
83+
Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, and zuban. It is the goal and desire to add additional type checkers over time.
8584

8685
## Adding a New Test Case
8786

conformance/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tomli
22
tomlkit
3-
tqdm
43
pyright
54
mypy
65
pip
7-
pyre-check; platform_system != "Windows"
6+
zuban
7+
pyrefly

conformance/results/mypy/aliases_newtype.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
conformant = "Partial"
22
notes = """
3-
`NewType`s are considered classes, not functions.
3+
`NewType`s are incorrectly considered to be classes.
44
"""
55
output = """
66
aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" [arg-type]

conformance/results/mypy/annotations_forward_refs.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [a
3131
"""
3232
conformance_automated = "Fail"
3333
errors_diff = """
34-
Line 22: Expected 1 errors
35-
Line 23: Expected 1 errors
3634
Line 24: Expected 1 errors
3735
Line 25: Expected 1 errors
38-
Line 66: Expected 1 errors
3936
Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]']
4037
Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type]']
4138
"""

conformance/results/mypy/annotations_generators.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ annotations_generators.py:119: error: Incompatible types in "yield from" (actual
1616
"""
1717
conformance_automated = "Fail"
1818
errors_diff = """
19-
Line 87: Expected 1 errors
20-
Line 92: Expected 1 errors
2119
Line 135: Expected 1 errors
2220
"""

conformance/results/mypy/classes_classvar.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ output = """
99
classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [valid-type]
1010
classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type]
1111
classes_classvar.py:40: error: Name "var" is not defined [name-defined]
12-
classes_classvar.py:45: error: ClassVar cannot contain type variables [misc]
13-
classes_classvar.py:46: error: ClassVar cannot contain type variables [misc]
1412
classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment]
1513
classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc]
1614
classes_classvar.py:55: error: Invalid type: ClassVar nested inside other type [valid-type]
@@ -20,7 +18,9 @@ classes_classvar.py:70: error: ClassVar can only be used for assignments in clas
2018
classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc]
2119
classes_classvar.py:73: error: ClassVar can only be used for assignments in class body [misc]
2220
classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc]
21+
classes_classvar.py:78: error: ClassVar[...] can't be used inside a type alias [valid-type]
2322
classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc]
23+
classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]
2424
classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment]
2525
classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member:
2626
classes_classvar.py:140: note: z
@@ -29,7 +29,9 @@ classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable,
2929
"""
3030
conformance_automated = "Fail"
3131
errors_diff = """
32+
Line 45: Expected 1 errors
33+
Line 46: Expected 1 errors
3234
Line 47: Expected 1 errors
33-
Line 78: Expected 1 errors
3435
Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]']
36+
Line 130: Unexpected errors ['classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]']
3537
"""

0 commit comments

Comments
 (0)