This is a small cosmetic change. I want to encourage use of the
nicer-lookng pytype.config.Options.create() rather than
direct construction of the command-line args, so I'm changing
over all occurrences of the latter that I can find.
This runs mypy both with Python 3.7 and 3.8. In Python 3.8,
mypy switched from using typed-ast to using Python's built-in ast.
This patch ensures that both are tested.
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.
All Python 3 versions supported by typeshed (3.4+) have enum as part
of the standard library.
Make the third-party Python 2 version consistent with the Python 3 version.
* 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.
pathlib2 is the Python 2.7 backport of the pathlib module from Python 3.
Hence we use the same stub file for both.
The maintainer of pathlib2 granted permission for stubs to be added in
mcmtroffaes/pathlib2#44.
This was already the configuration in Travis and it's been working fine. It's
confusing that Travis was using a different configuration than the default
when you run tests/mypy_test.py yourself.
Make the Python 2 and 3 concurrent.futures stubs identical so fixes get
applied to both.
For example, #1305 and #2233 fixed the same problem at different times,
as did #1078 and #1911.
By making the stubs identical, we apply the fix from #1711 to Python 2.
Fixes#2234.
* 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.
The dict stub was referring to an instance, not the type, leading to
__call__ being considered when using as a decorator, rather than
__init__.
mock is a backport of the stdlib module and should be defined the same.
* adding ascii, panal and textpad modules to the curses module.
* added curses/panel.pyi and curses/textpad.pyi to test/pytype_blacklist.txt
just like curses/__init__.pyi because they all import _curses. (This
may not be the right thing to do)