This also makes the flask stubs that depend on click parseable.
* In pytype_test, only parse files with the .pyi extension.
(There's a README in third_party/2and3/click/.)
* Annotate with ContextManager rather than using the
contextmanager decorator. This is shorter, removes a
dependency, and gets rid of the slight weirdness of a
decorator needing to be evaluated in a stub.
* Fix non-stub things.
During the PyCon sprints, I'm planning to bash the pytype pyi
parser into shape so we can handle all of third_party. As a first
step, create an explicit blacklist of everything pytype chokes on.
With today's release, pytype is able to fully load
stdlib/3/collections/__init__.pyi, so the test no longer needs the
ability to partially parse stubs using the pytd tool. Removing this
functionality allows the test code to be simplified considerably.
Speeds up pytype considerably by directly calling pytype.io.parse_pyi
rather than running `pytype --parse-pyi` in a subprocess.
The subprocess logic is still required to handle the one pyi file
marked `# parse only` in the pytype blacklist. Once
https://github.com/google/pytype/issues/242 is fixed, the test code
can be cleaned up considerably.
* Moves the pytype installation to requirements-tests-py3.txt, now
that pytype can run under Python 3.5+.
* Changes tests/pytype_test.py to not require a --python{version}-exe
argument when it can automatically find the Python interpreter, and
cleans up a few typos and out-of-date things.
* Updates the appropriate documentation.
* Updates .travis.yml.
* Add parts of third_party/ to pytype_test.
Pytype uses six and mypy_extensions, so these pyi files should be
tested with pytype.
* Remove newly loadable pyi files from pytype_blacklist.
All of these files can not be used with pytype at HEAD. They fail during import with various error messages. Make the test script actually load the files and all dependencies of it, instead of just verifying that it can be parsed.
This list was generated by running pytype with more options.
1: typeshed-location was pointed to the current typeshed instead of the one shipped with pytype.
2: --module-name=<foo> was provided as a parameter. Without this parameter wildcard imports "from _ast import *" misbehave.
Files with a "# parse only" comment will only be parsed and not loaded.