Commit Graph

722 Commits

Author SHA1 Message Date
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
Sebastian Rittau
ad3f0c8e34 Allow non-types dependencies (#5769)
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
2021-07-14 14:29:53 +02:00
Sebastian Rittau
7c382c7cd8 Run mypy tests for stdlib and third-party separately (#5760) 2021-07-12 10:09:13 +02:00
Anton Grübel
0085539df3 Add missing type hints in http.client (#5734)
* Add missing type hints in http.client

* Add http.client.HTTPConnection.response_class to exclude list
2021-07-08 14:43:42 +03:00
Sebastian Rittau
2b64f54008 Support @tests/requirements-stubtest.txt files (#5704) 2021-06-28 19:42:27 +02:00
github-actions[bot]
1fb100dca4 Remove unused stubtest allowlist entries (#5697)
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com>
2021-06-26 21:28:00 -07:00
Jake Bailey
96429cd4bd Update pyright to 1.1.152 (#5685) 2021-06-24 00:11:33 +02:00
Akuli
11b99e1141 @python2 nits (#5672)
* tiny tests/mypy_test.py cleanup

* try to make CONTRIBUTING.md less confusing
2021-06-21 21:42:45 +03:00
Sebastian Rittau
68dc2d132b Move Python 2-only stubs to @python2 directory (#5660) 2021-06-21 11:28:25 -07:00
Sebastian Rittau
a319ba4604 pkg_resources is part of setuptools (#5669) 2021-06-21 15:19:18 +01:00
Sebastian Rittau
bc2ec748f6 Move routes stubs to @python2 directory (#5637)
* Move routes stubs to @python2 directory

* Ignore Python-2-only stubs for stubtest

* Use standard idiom for re-exporting items

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-18 17:05:23 +03:00
Sebastian Rittau
3368258e4a Add distributions arg to third-party stubtest (#5628)
* Add distributions arg to third-party stubtest

Make stubtest_third_party.py executable

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-13 14:53:29 +03:00
Shantanu
7244ea1f71 Test third party stubs with stubtest (#5615) 2021-06-13 00:17:40 +02:00
Shantanu
e66ceceed0 Rename whitelist to allowlist (#5614)
Resolves #4436

I want to add stubtest for third party stubs, and figured it'd be easier
to make this change now.

Co-authored-by: hauntsaninja <>
2021-06-10 14:33:44 -07:00
Jake Bailey
c4dc935b3f Add a stricter config pass for pyright (#5612) 2021-06-10 20:10:12 +02:00
Akuli
63fd1688c5 Delete attrs (#5585)
Closes #5581
2021-06-08 16:02:38 +02:00
github-actions[bot]
af068d6d3c Remove unused stubtest whitelist entries (#5563) 2021-05-31 22:30:19 -07:00
Sebastian Rittau
6ee67483a3 Rework socket (#5545)
* Extract _socket.pyi from socket.pyi.
* Extract _socket.socket from socket.socket.
* Fix socket.family annotation.
* Annotate SocketIO properly.
* SocketType is an alias of _socket.socket.
* Sort items in socket.pyi in the same order as in socket.py.
* Remove socket.EINTR.
* Use _typeshed.WriteableBuffer instead of custom alias.
* Add errorTab (Windows only).
* Add _socket.dup().
* Mark positional-only argments.
* Remove constructors from socket exceptions.
* socket.timeout is an alias for TimeoutError, starting with Python 3.10.
* Use PEP 604 in changed lines.
* Add alias for fileno arguments.
* getaddrinfo() port can be bytes.
* Explicitly override some SSLSocket methods.
* Allow ReadableBuffer in _CMSG arguments.
2021-05-30 20:17:33 +02:00
Jelle Zijlstra
e47eff31f7 bump various dependencies (#5551) 2021-05-29 20:05:09 +03:00