Commit Graph

406 Commits

Author SHA1 Message Date
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
Sebastian Rittau
9795bae6f7 Remove mypy_test_suite (#5543)
Closes: #5540
2021-05-28 05:00:48 -07:00
github-actions[bot]
9b2f158fdb Remove unused stubtest whitelist entries (#5531) 2021-05-25 21:43:12 -07:00
Shantanu
05f91f73b3 Re-enable mypy test suite (#5526)
Fixes #5505, in combination with https://github.com/python/mypy/pull/10527

Co-authored-by: hauntsaninja <>
2021-05-25 09:42:18 +01:00
Jake Bailey
6d0b7889d3 Bump to pyright 1.1.142 (#5515) 2021-05-21 10:32:22 -07:00
Sebastian Rittau
21e647a184 Document _typeshed (#5501)
* Document _typeshed

Closes: #5486

* Allow README.md files
2021-05-19 22:15:21 +03:00
Sebastian Rittau
54a0bd80ee Add a comment about _typeshed to VERSIONS (#5447) 2021-05-19 11:01:33 +02:00
Jake Bailey
0351168b40 Bump pyright to 1.1.140 (#5480) 2021-05-16 19:20:18 -07:00
Sebastian Rittau
35acd2ad6f check_consistent: allow dots in module names (#5472) 2021-05-16 11:01:00 -07:00
hatal175
b8e5f637b9 Stubtest fixes (#5391) 2021-05-13 18:20:55 -07:00
Sebastian Rittau
3ba35f3552 Split the tests section, extend ToC (#5433)
Move and consolidate venv setup and running isort/black/flake8 into
separate sections and link those sections from the ToC. Also extend
those sections slightly.

Move the tests section into a separate file.

Make venv name in pre-commit match name in CONTRIBUTING.
2021-05-13 15:41:04 +02:00
github-actions[bot]
15e31fe54b Remove unused stubtest whitelist entries (#5431) 2021-05-12 22:22:32 -07:00
Sebastian Rittau
2f30adad19 Remove two files from pytype's exclude list (#5427) 2021-05-12 11:58:48 -07:00
Sebastian Rittau
6a4583d0a8 Deprecate pallets stubs (#5424)
Part of #5423

* Support new metadata fields in check_consistent
2021-05-12 19:17:42 +03:00
Shantanu
6bb1d885c6 time: fix constants availability (#5419) 2021-05-12 08:35:39 +02:00
github-actions[bot]
a2d5f72e8a Remove unused stubtest whitelist entries (#5418)
Co-authored-by: hauntsaninja <hauntsaninja@users.noreply.github.com>
2021-05-11 22:25:19 -07:00
Shantanu
4df940f96d Update allowlists (#5417)
Co-authored-by: hauntsaninja <>
2021-05-11 22:11:48 -07:00