Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
# Set linguist-language to support comments syntax highlight
**/stubtest_allowlist*.txt linguist-language=ini
**/stubtest_allowlists/*.txt linguist-language=ini
tests/pytype_exclude_list.txt linguist-language=ini
pyrightconfig*.json linguist-language=jsonc
.vscode/*.json linguist-language=jsonc
8 changes: 4 additions & 4 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
{
groupName: "most test/lint dependencies",
matchManagers: ["pip_requirements", "pre-commit"],
matchPackageNames: ["!pytype", "!pyright"],
matchPackageNames: ["!pyright"],
description: "Quarterly update of most test dependencies",
schedule: ["every 3 months on the first day of the month"]
},
{
"groupName": "pytype and pyright",
"groupName": "pyright",
"matchManagers": ["pip_requirements"],
"matchPackageNames": ["pytype", "pyright"],
"description": "Daily update of pyright and pytype",
"matchPackageNames": ["pyright"],
"description": "Daily update of pyright",
"schedule": ["before 4am"]
}
]
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,6 @@ jobs:
- run: uv pip install -r requirements-tests.txt --system
- run: python ./tests/check_typeshed_structure.py

pytype:
name: "pytype: Check stubs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
# Max supported Python version as of pytype 2024.10.11
python-version: "3.12"
- uses: astral-sh/setup-uv@v6
with:
version-file: "requirements-tests.txt"
- run: uv pip install -r requirements-tests.txt --system
- name: Install external dependencies for 3rd-party stubs
run: |
DEPENDENCIES=$( python tests/get_external_stub_requirements.py )
if [ -n "$DEPENDENCIES" ]; then
printf "Installing packages:\n $(echo $DEPENDENCIES | sed 's/ /\n /g')\n"
uv pip install --system $DEPENDENCIES
fi
- run: uv pip freeze
- run: ./tests/pytype_test.py --print-stderr

mypy:
name: "mypy: Check stubs"
runs-on: ubuntu-latest
Expand Down
11 changes: 0 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,6 @@ Note that some tests require extra setup steps to install the required dependenc
(.venv) > pip install -r requirements-tests.txt
```

To be able to run pytype tests, you'll also need to install it manually
as it's currently excluded from the requirements file:

```powershell
(.venv) > pip install -U pytype
```

</td>
</tr>
<tr><!-- disables zebra striping --></tr>
Expand All @@ -104,10 +97,6 @@ as it's currently excluded from the requirements file:
uv pip install -r requirements-tests.txt
```

```shell
uv pip install -U pytype
```

</td>
</tr>
</table>
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Typeshed supports Python versions 3.9 to 3.14.

## Using

If you're just using a type checker ([mypy](https://github.com/python/mypy/),
[pyright](https://github.com/microsoft/pyright),
[pytype](https://github.com/google/pytype/), PyCharm, ...), as opposed to
If you're just using a type checker (e.g. [mypy](https://github.com/python/mypy/),
[pyright](https://github.com/microsoft/pyright), or PyCharm's built-in type
checker), as opposed to
developing it, you don't need to interact with the typeshed repo at
all: a copy of standard library part of typeshed is bundled with type checkers.
And type stubs for third party packages and modules you are using can
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ exclude = [
# cache directories, etc.:
".git",
".mypy_cache",
".pytype",
]

[tool.ruff.lint]
Expand Down
2 changes: 0 additions & 2 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# be pinned to a specific version to make failure reproducible.
mypy==1.16.1
pyright==1.1.403
# pytype can be installed on Windows, but requires building wheels, let's not do that on the CI
pytype==2024.10.11; platform_system != "Windows" and python_version >= "3.10" and python_version < "3.13"

# Libraries used by our various scripts.
# TODO (2025-05-09): Installing this on Python 3.14 on Windows fails at
Expand Down
16 changes: 1 addition & 15 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
This directory contains several tests:
- `tests/mypy_test.py`
tests the stubs with [mypy](https://github.com/python/mypy/)
- `tests/pytype_test.py` tests the stubs with
[pytype](https://github.com/google/pytype/).
- `tests/pyright_test.py` tests the stubs with
[pyright](https://github.com/microsoft/pyright).
- `tests/regr_test.py` runs mypy against the test cases for typeshed's
Expand All @@ -19,7 +17,7 @@ in the `tests` and `scripts` directories.
To run the tests, follow the [setup instructions](../CONTRIBUTING.md#preparing-the-environment)
in the `CONTRIBUTING.md` document. In particular, you have to run with Python 3.9+.

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

## pytype\_test.py

Note: This test cannot be run on Python version < 3.13 as pytype does not yet support
Python 3.13 and above.

Run using:
```bash
(.venv3)$ python3 tests/pytype_test.py
```

This test works similarly to `mypy_test.py`, except it uses `pytype`.

## pyright\_test.py

This test requires [Node.js](https://nodejs.org) to be installed. Although
Expand Down
2 changes: 1 addition & 1 deletion tests/check_typeshed_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

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

ALLOWED_PY_FILES_IN_TESTS_DIR = {
"django_settings.py" # This file contains Django settings used by the mypy_django_plugin during stubtest execution.
Expand Down
28 changes: 0 additions & 28 deletions tests/pytype_exclude_list.txt

This file was deleted.

Loading
Loading