Jelle Zijlstra
1f1bc6f27c
add pre-commit config ( #6341 )
...
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2021-11-19 16:46:51 +02:00
Jelle Zijlstra
0d7064c357
Make Mapping/MutableMapping params positional-only ( #5772 )
...
These are positional-only on dict, so it makes sense to mark them as positional-only in these base classes too.
Fixes #5771
2021-11-18 07:54:58 +01:00
Sebastian Rittau
77810277d5
Recommend to use mypy error codes if applicable ( #6305 )
2021-11-17 21:58:05 -08:00
Sebastian Rittau
bcc743dd2b
mypy_test: Skip files starting with '.' ( #6306 )
2021-11-16 17:00:39 +02:00
Sebastian Rittau
edf82e8094
Clean up mypy flags ( #6308 )
...
* Remove --strict-optional: This has been the default since mypy 0.600.
* Remove --disallow-subclassing-any: When we subclass Any in typeshed,
we do so deliberately. This just causes us to add unncessary ignores.
2021-11-16 12:58:53 +00:00
Alex Waygood
aa7e277adb
Harmonise return type of builtins.__import__ and importlib.import_module ( #6302 )
...
builtins.__import__ now returns ModuleType instead of Any. In addition, add __getattr__() to ModuleType to ease using imported modules.
2021-11-15 16:21:46 +01:00
Jelle Zijlstra
9eabedca5f
Make NoReturn a SpecialForm ( #6290 )
...
This is consistent with the runtime definition: https://github.com/python/cpython/blob/main/Lib/typing.py#L434 .
The previous definition was wrong; NoReturn is not and should not be equivalent to None. This fixes an issue in pyanalyze where it was interpreting NoReturn as equivalent to None.
2021-11-12 17:34:44 -08:00
Sebastian Rittau
5bd747570d
Update Python version for pytype ( #6288 )
2021-11-12 22:26:22 +01:00
Alex Waygood
4b3a8a8790
Improve support for running tests on Windows ( #6284 )
2021-11-12 17:09:20 +01:00
Shantanu
bf92378722
Bump typed-ast version, recommend Python 3.8 for tests ( #6278 )
2021-11-12 02:53:42 -08:00
Sebastian Rittau
e22b63d9cc
Reduce mypy_test output ( #6268 )
...
Only print the mypy command twice per version: Once for the stdlib and
once for the stubs. Use a dummy /tmp path. Add a header for each tested
Python version and remove the Python version from the individual stubs.
2021-11-09 18:03:29 +01:00
luzpaz
b95b729b9e
Fix typos ( #6263 )
...
Found via `codespell -q 3 -L alo,asend,ba,nams,spawnve`
2021-11-08 18:23:15 -08:00
Sebastian Rittau
3876587a65
Remove support for mypy_exclude_list ( #6230 )
2021-11-08 10:45:46 +02:00
Sebastian Rittau
50c1f2ab7c
Test third-party stubs in isolation ( #6229 )
2021-11-07 15:05:49 -08:00
Alex Waygood
d5d0ba158e
Make `__round__ positional-only for float, int, Decimal and SupportsRound` ( #6242 )
2021-11-07 15:05:18 -08:00
Sebastian Rittau
0958692028
Suppress unnecessary traceback ( #6253 )
2021-11-07 07:35:31 -08:00
github-actions[bot]
59dfea08c3
Remove unused stubtest allowlist entries ( #6227 )
2021-11-02 21:17:15 -07:00
Sebastian Rittau
ce94db762c
Update pytype and pyright ( #6222 )
...
* Upgrade pytype
* Update pyright
2021-11-02 09:19:07 -07:00
Shantanu
9f691d9c6e
stubtest_third_party: advice for unused allowlist entries ( #6208 )
...
Co-authored-by: hauntsaninja <>
2021-10-27 21:55:18 -07:00
Akuli
994b69ef8f
Use lowercase tuple where possible ( #6170 )
2021-10-14 17:18:19 -07:00
Akuli
b2082ce559
check_new_syntax.py: improve dicts in error message ( #6168 )
...
Improve error message for bad dict. Before dict[(int, str)] now dict[int, str]
2021-10-13 18:14:05 -07:00
Akuli
75ca712f3c
check_new_syntax.py: check nested annotations ( #6167 )
2021-10-14 00:28:38 +03:00
Akuli
e72a4034bf
Cleanup: use lower-case list and dict, add a test ( #6161 )
2021-10-13 22:59:27 +03:00
github-actions[bot]
54ff11bf9f
Remove unused stubtest allowlist entries ( #6158 )
...
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com >
2021-10-12 22:17:04 -07:00
Sebastian Rittau
bb24e77404
Update remaining versions for third-party stubs ( #6094 )
...
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 >
2021-10-12 12:30:45 +02:00
Sebastian Rittau
9f86972350
Add star to all non-0.1 versions ( #6146 )
2021-10-11 13:41:19 -07:00
Sebastian Rittau
46fc031ee7
Allow third-party versions to end in asterisk ( #6129 )
...
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 >
2021-10-11 00:46:18 +02:00
github-actions[bot]
a3e4fcca26
Remove unused stubtest allowlist entries ( #6119 )
...
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com >
2021-10-05 21:07:49 -07:00
Jake Bailey
2912ab0092
Update pyright to 1.1.175 ( #6110 )
2021-10-04 18:17:24 -07:00
Shantanu
67e8979ac1
stubtest_third_party: more newlines in printing ( #6060 )
...
Co-authored-by: hauntsaninja <>
2021-09-21 23:16:12 +02:00
Anton Grübel
caa642dd3b
improve typing in inspect ( #6020 )
2021-09-18 20:11:55 -07:00
Sebastian Rittau
0506182348
Allow three-component third-party versions ( #5995 )
...
Closes : #5992
2021-09-18 20:08:51 -07:00
Screwtapello
4c6e98ed0c
Add many missing tkinter type annotations ( #6002 )
...
Co-authored-by: Sebastian Rittau <srittau@rittau.biz >
Co-authored-by: Akuli <akuviljanen17@gmail.com >
2021-09-12 11:42:12 +03:00
Nikita Sobolev
392c81d767
Switch from toml to tomli ( #6023 )
2021-09-10 15:48:15 +02:00
Anton Grübel
1af6810b5d
Improve typing in zipfile ( #5991 )
...
* Improve typing in zipfile
* fix CR suggestions
2021-09-03 13:02:11 +02:00
Akuli
cd90721604
Clean up tests/check_pep_604.py ( #5980 )
2021-08-28 21:56:53 -07:00
github-actions[bot]
ed25989ef2
Remove unused stubtest allowlist entries ( #5981 )
...
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com >
2021-08-28 21:22:24 -07:00
Shantanu
ba998cd5f9
multiprocessing.pool: fix __init__ methods ( #5833 )
...
Co-authored-by: hauntsaninja <>
2021-08-28 12:04:08 -07:00
Shantanu
670929e908
dateparser: use PEP 604 ( #5977 )
...
Co-authored-by: hauntsaninja <>
2021-08-28 21:03:02 +02:00
Shantanu
f6e4c9c38f
Check for PEP 604 usage in CI ( #5903 )
...
Since this is a common review issue and our stubs have all been
converted
Co-authored-by: hauntsaninja <>
2021-08-28 11:37:50 -07:00
Rebecca Chen
fac273a545
Stop using pytype.pytd.typeshed.get_python_major_versions. ( #5941 )
...
We deleted this method as part of our Python 2 cleanup efforts.
2021-08-19 18:36:19 -07:00
Rebecca Chen
4e228870bb
Stop running pytype_test on Python 2-only stubs. ( #5904 )
...
pytype is finally dropping Python 2 support (in the upcoming release
after 2021.08.03), so pytype_test can no longer run with
--python_version=2.
2021-08-10 09:36:10 +02:00
github-actions[bot]
b9adb7a874
Remove unused stubtest allowlist entries ( #5875 )
...
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com >
2021-08-07 21:06:25 -07:00
Eric Traut
59624ff09c
Updated pyright version to 1.1.160 ( #5857 )
...
* Updated pyright version to 1.1.160. Older versions contained a bug that prevented multiple third-party stub packages from having the same top-level module name.
* Disabled "reportUnsupportedDunderAll" diagnostic check for now.
Co-authored-by: Eric Traut <erictr@microsoft.com >
2021-08-06 09:21:57 +02:00
Shantanu
76eeeee4c4
[minor] Clearer formatting for stubtest_third_party output ( #5856 )
...
Co-authored-by: hauntsaninja <>
2021-08-05 20:16:46 -07:00
Bas van Beek
475417fa97
Mark final and unhashable classes in types as such ( #5837 )
2021-08-02 13:46:14 -07:00
Eric Traut
ea4be02bab
Redefined dataclasses.KW_ONLY ( #5826 )
...
Redefined dataclasses.KW_ONLY so it's a type alias rather than a class instance. Class instances are illegal to use within a type annotation.
2021-08-01 08:06:48 -07:00
Sebastian Rittau
2410c4f751
Add missing items for distutils.command.* ( #5773 )
...
This was mostly generated by running stubgen. Existing annotations were
kept, but converted to use PEP 604 and PEP 585.
2021-07-24 14:04:17 -07:00
Shiva Raisinghani
e24f940c7d
Stubs for braintree ( #5789 )
...
A library that provides integration access to the Braintree Gateway.
I started with stubgen, then cleaned up to address missing functions. Testing plan is to keep an eye on CI and fix any issues that arise.
2021-07-24 13:47:14 -07:00
Jukka Lehtosalo
2d3bde439e
Stubs for mysqlclient ( #5791 )
2021-07-19 10:28:00 +02:00