For now, the test requires changes that have been merged into the pytype master branch but not yet released. I'll update requirements-tests-py3.txt again once I've cut a new release (hopefully later this week).
* Fix pytype_test.
* Re-enable pytype_test.
* Remove continue-on-error from pytype_test.
* Temporarily install pytype from its master branch, as the code to
support the new directory structure hasn't been released yet.
* Set TYPESHED_HOME before using pytype.pytd.Typeshed().
* Add _collections_abc module
* Rearrange collections.abc and collections to re-export from _collections_abc
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
I noticed that the pytype parse test was getting quite slow again. This
is a somewhat hacky change that caches pytype's internal pyi loader to
avoid parsing files multiple times. On my machine, the test goes from
taking ~6m to complete to ~30s.
* Add script to generate protoc stubs using mypy-protobuf generated stubs
* Use generate_proto_stubs to generate stubs for protobuf 3.14.0
* Skip _pb2.pyi from flake8,black,isort,pytype
[tests/pytype_test.py](./tests/pytype_test.py#L176) is still using
Python `3.6`:
> python_version="2.7" if version == 2 else "3.6",
The test fails to run if `python3.6` is unavailable (for example on
Debian 10 Buster, which has 3.7).
According to (https://devguide.python.org/#status-of-python-branches
`3.6` is still maintained until end of 2021.
`pytype` itself [claims](https://github.com/google/pytype#requirements)
to run on `2.7`, `3.5`-`3.8`.
Change the script to use the version of Python from the invoking
interpreter.
The previous typing meant `threading.ExceptHookArgs` could not be used
to type a value.
The new typing follows what cpython does in the happy path (`_thread`
exists rather than the pure-python fallback being used).
Fixes#4767.
* typeshed: update stubtest version
Includes changes from https://github.com/python/mypy/pull/9680
I've already fixed all the true positives on typeshed.
* attempt to fix windows' _WarnFunction
Co-authored-by: hauntsaninja <>
Only a subset of mypy's test suite should be relevant to typeshed:
https://github.com/python/mypy/pull/9638
This should make things faster.
(Also the -n12 argument to pytest is weird; note mypy's pytest.ini
automatically specificies -nauto which is what we should want)
Resolves https://github.com/python/typeshed/issues/4333
Co-authored-by: hauntsaninja <>
In #4696 I bumped stubtest to a commit that hasn't been released. We
should have these stubtest versions match. In
https://github.com/python/mypy/pull/9426 I changed the output of
stubtest here; it's good to get this change in before I forget and this
action silently stops working.
Co-authored-by: hauntsaninja <>