- Add several type hints to untyped functions.
- While we're at it, upgrade several annotations to use modern syntax by using `from __future__ import annotations`. This means that the tests can't be run on Python 3.6, but 3.6 is EOL, and it is already the case that some scripts in this directory can only be run on more recent Python versions. E.g. `check_new_syntax.py` uses `ast.unparse`, which is only available in Python 3.9+.
- Fix a few pieces of code that didn't type check.
Some distributions can't be tested with stubtest for a variety of
reasons or because of bugs in stubtest. This key:
* let's us keep metadata about a distribution in one place,
* prevents us from modifying the scripts because of issues with a
specific distribution, and
* will trigger tests if only the key is changed.
Also remove the python2 markers of packages that don't list Python 2
as supported in the latest version.
Don't special case version '0.1'
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This is a first step towards #6095, where x.y and x.y.* are treated as
equivalent. The next step is to update existing versions to use x.y.*
where applicable and then treat x.y differently.
Co-authored-by: Akuli <akuviljanen17@gmail.com>
Remove the check in check_consistency that ensures that only other
type packages from typeshed are being depended on. Instead, add an
explanation to CONTRIBUTING that spells out the requirements. This
adds a higher, but reasonable burden on maintainers to check the
dependencies manually.
Part of #5768
* Mark stdlib modules with upper version bounds
* Add minus to all versions and enforce in check_consistent
* Fix check_consistent and mypy_test to work with new VERSIONS format
* flake8 updates and cleanups
* Update to flake8 3.7.9.
* Update to flake8-bugbear 20.1.4.
* Only ignore errors in stub files.
* Remove obsolete error counts.
* Sort error codes alphabetically.
* Don't ignore the following errors (unneeded):
* E704 Multiple statements on one line (def)
* W504 Line break occurred after a binary operator
* B303 __metaclass__ used
* Remove obsolete comment
* Ignore F822 undefined name in __all__
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.
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.
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.
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.