Skip to content

Commit aebefb1

Browse files
authored
Remove support for pytype (#14463)
1 parent df8de9e commit aebefb1

12 files changed

+9
-356
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
# Set linguist-language to support comments syntax highlight
55
**/stubtest_allowlist*.txt linguist-language=ini
66
**/stubtest_allowlists/*.txt linguist-language=ini
7-
tests/pytype_exclude_list.txt linguist-language=ini
87
pyrightconfig*.json linguist-language=jsonc
98
.vscode/*.json linguist-language=jsonc

.github/renovate.json5

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
{
2525
groupName: "most test/lint dependencies",
2626
matchManagers: ["pip_requirements", "pre-commit"],
27-
matchPackageNames: ["!pytype", "!pyright"],
27+
matchPackageNames: ["!pyright"],
2828
description: "Quarterly update of most test dependencies",
2929
schedule: ["every 3 months on the first day of the month"]
3030
},
3131
{
32-
"groupName": "pytype and pyright",
32+
"groupName": "pyright",
3333
"matchManagers": ["pip_requirements"],
34-
"matchPackageNames": ["pytype", "pyright"],
35-
"description": "Daily update of pyright and pytype",
34+
"matchPackageNames": ["pyright"],
35+
"description": "Daily update of pyright",
3636
"schedule": ["before 4am"]
3737
}
3838
]

.github/workflows/tests.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,6 @@ jobs:
3434
- run: uv pip install -r requirements-tests.txt --system
3535
- run: python ./tests/check_typeshed_structure.py
3636

37-
pytype:
38-
name: "pytype: Check stubs"
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: actions/checkout@v4
42-
- uses: actions/setup-python@v5
43-
with:
44-
# Max supported Python version as of pytype 2024.10.11
45-
python-version: "3.12"
46-
- uses: astral-sh/setup-uv@v6
47-
with:
48-
version-file: "requirements-tests.txt"
49-
- run: uv pip install -r requirements-tests.txt --system
50-
- name: Install external dependencies for 3rd-party stubs
51-
run: |
52-
DEPENDENCIES=$( python tests/get_external_stub_requirements.py )
53-
if [ -n "$DEPENDENCIES" ]; then
54-
printf "Installing packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
55-
uv pip install --system $DEPENDENCIES
56-
fi
57-
- run: uv pip freeze
58-
- run: ./tests/pytype_test.py --print-stderr
59-
6037
mypy:
6138
name: "mypy: Check stubs"
6239
runs-on: ubuntu-latest

CONTRIBUTING.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,6 @@ Note that some tests require extra setup steps to install the required dependenc
8383
(.venv) > pip install -r requirements-tests.txt
8484
```
8585

86-
To be able to run pytype tests, you'll also need to install it manually
87-
as it's currently excluded from the requirements file:
88-
89-
```powershell
90-
(.venv) > pip install -U pytype
91-
```
92-
9386
</td>
9487
</tr>
9588
<tr><!-- disables zebra striping --></tr>
@@ -104,10 +97,6 @@ as it's currently excluded from the requirements file:
10497
uv pip install -r requirements-tests.txt
10598
```
10699

107-
```shell
108-
uv pip install -U pytype
109-
```
110-
111100
</td>
112101
</tr>
113102
</table>

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ Typeshed supports Python versions 3.9 to 3.14.
2525

2626
## Using
2727

28-
If you're just using a type checker ([mypy](https://github.com/python/mypy/),
29-
[pyright](https://github.com/microsoft/pyright),
30-
[pytype](https://github.com/google/pytype/), PyCharm, ...), as opposed to
28+
If you're just using a type checker (e.g. [mypy](https://github.com/python/mypy/),
29+
[pyright](https://github.com/microsoft/pyright), or PyCharm's built-in type
30+
checker), as opposed to
3131
developing it, you don't need to interact with the typeshed repo at
3232
all: a copy of standard library part of typeshed is bundled with type checkers.
3333
And type stubs for third party packages and modules you are using can

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ exclude = [
2323
# cache directories, etc.:
2424
".git",
2525
".mypy_cache",
26-
".pytype",
2726
]
2827

2928
[tool.ruff.lint]

requirements-tests.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# be pinned to a specific version to make failure reproducible.
33
mypy==1.16.1
44
pyright==1.1.403
5-
# pytype can be installed on Windows, but requires building wheels, let's not do that on the CI
6-
pytype==2024.10.11; platform_system != "Windows" and python_version >= "3.10" and python_version < "3.13"
75

86
# Libraries used by our various scripts.
97
# TODO (2025-05-09): Installing this on Python 3.14 on Windows fails at

tests/README.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
This directory contains several tests:
22
- `tests/mypy_test.py`
33
tests the stubs with [mypy](https://github.com/python/mypy/)
4-
- `tests/pytype_test.py` tests the stubs with
5-
[pytype](https://github.com/google/pytype/).
64
- `tests/pyright_test.py` tests the stubs with
75
[pyright](https://github.com/microsoft/pyright).
86
- `tests/regr_test.py` runs mypy against the test cases for typeshed's
@@ -19,7 +17,7 @@ in the `tests` and `scripts` directories.
1917
To run the tests, follow the [setup instructions](../CONTRIBUTING.md#preparing-the-environment)
2018
in the `CONTRIBUTING.md` document. In particular, you have to run with Python 3.9+.
2119

22-
In order for `pytype_test` and `pyright_test` to work correctly, some third-party stubs
20+
In order for `pyright_test` to work correctly, some third-party stubs
2321
may require extra dependencies external to typeshed to be installed in your virtual environment
2422
prior to running the test.
2523
You can list or install all of a stubs package's external dependencies using the following script:
@@ -67,18 +65,6 @@ imported but doesn't check whether stubs match their implementation
6765
Run `python tests/mypy_test.py --help` for information on the various configuration options
6866
for this script.
6967

70-
## pytype\_test.py
71-
72-
Note: This test cannot be run on Python version < 3.13 as pytype does not yet support
73-
Python 3.13 and above.
74-
75-
Run using:
76-
```bash
77-
(.venv3)$ python3 tests/pytype_test.py
78-
```
79-
80-
This test works similarly to `mypy_test.py`, except it uses `pytype`.
81-
8268
## pyright\_test.py
8369

8470
This test requires [Node.js](https://nodejs.org) to be installed. Although

tests/check_typeshed_structure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
# These type checkers and linters must have exact versions in the requirements file to ensure
2727
# consistent CI runs.
28-
linters = {"mypy", "pyright", "pytype", "ruff"}
28+
linters = {"mypy", "pyright", "ruff"}
2929

3030
ALLOWED_PY_FILES_IN_TESTS_DIR = {
3131
"django_settings.py" # This file contains Django settings used by the mypy_django_plugin during stubtest execution.

tests/pytype_exclude_list.txt

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)