You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Clone the https://github.com/python/typing repo.
73
-
*Create and activate a Python 3.12 virtual environment.
74
-
* Switch to the `conformance` subdirectory and install all dependencies (`pip install -r requirements.txt`).
75
-
*Switch to the `src` subdirectory and run `python main.py`.
74
+
*Install [uv](https://docs.astral.sh/uv/)and ensure Python 3.12 is available.
75
+
* Switch to the `conformance` subdirectory and install locked dependencies (`uv sync --python 3.12 --frozen`).
76
+
*Run the conformance tool (`uv run --python 3.12 --frozen python src/main.py`).
76
77
77
78
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.
79
79
80
80
## Reporting Conformance Results
81
81
82
82
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.
83
83
84
-
Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyre, pyright, and pytype. It is the goal and desire to add additional type checkers over time.
84
+
[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.
85
85
86
86
## Adding a New Test Case
87
87
@@ -93,7 +93,22 @@ If a test is updated (augmented or fixed), the process is similar to when adding
93
93
94
94
## Updating a Type Checker
95
95
96
-
If a new version of a type checker is released, re-run the test tool with the new version. If the type checker output has changed for any test cases, the tool will supply the old and new outputs. Examine these to determine whether the conformance status has changed. Once the conformance status has been updated, re-run the test tool again to regenerate the summary report.
96
+
Type checker versions are locked in `uv.lock`.
97
+
98
+
To bump all supported checkers to their latest released versions:
99
+
100
+
```bash
101
+
python scripts/bump_type_checkers.py
102
+
```
103
+
104
+
After bumping, install the new lockfile and rerun conformance:
105
+
106
+
```bash
107
+
uv sync --python 3.12 --frozen
108
+
uv run --python 3.12 --frozen python src/main.py
109
+
```
110
+
111
+
If checker output changes for any test cases, examine those deltas to determine whether the conformance status has changed. Once the conformance status has been updated, rerun the tool to regenerate the summary report.
0 commit comments