Commit Graph
100 Commits
Author SHA1 Message Date
Alex Waygood fceccd217c Upgrade mypy to 0.971 (#8332) 2022-07-19 16:27:05 +01:00
Alex Waygood e2ce7c6344 stdlib: audit more callback annotations (#8209) 2022-07-19 07:07:25 -07:00
Alex Waygood 540a6b25bf Improve urllib.parse.urldefrag (#8204)
Fixes #2477
2022-07-19 07:05:09 -07:00
Alex WaygoodandJelle Zijlstra e3d4bdc91a Third-party stubs: enforce CamelCase for type alias names (#8256)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-07-19 08:23:24 +01:00
Alex Waygood e156c63bdb inspect, asyncio: Use more TypeGuards (#8057) 2022-07-18 19:49:12 -07:00
Alex Waygood 4b504c78e0 Improve asyncio callbacks (#8192) 2022-07-18 19:46:38 -07:00
Alex Waygood 8af41720b6 Remove frozendict stubs (#8326) 2022-07-18 18:47:06 +01:00
Alex Waygood 35616b439f Run pycln as a pre-commit hook in CI (#8304) 2022-07-18 09:27:28 +02:00
Alex Waygood 1ebe1b463e Fix asyncio.gather regression (#8271)
Adding the empty-tuple overload caused major problems for pyright, and that overload only deals with an unlikely edge case anyway. Get rid of it, and replace the fallback overload with a more general overload.

Fixes #8270.
2022-07-16 18:56:58 +01:00
Alex Waygood 0764f9f31f tqdm: Add __all__ to __init__.pyi and submodules (#8308)
Fixes #8307
2022-07-15 17:39:45 +01:00
Alex Waygood ed0b3a4412 tqdm: Improve a few __init__ methods (#8246) 2022-07-15 10:30:24 +01:00
Alex Waygood 10f3238998 Add typing_extensions.NamedTuple (#8295)
Fixes https://github.com/python/typing_extensions/issues/56
2022-07-14 15:02:51 +01:00
Alex Waygood 9645dae925 int.denominator, int.imag: More precise return types (#8266) 2022-07-14 11:25:05 +01:00
Alex Waygood 6bc6289aaf Use stricter pyright settings for some tkinter stubs (#8291) 2022-07-13 17:16:16 +02:00
Alex Waygood a1af16bda5 fractions.pyi: Correct dunder parameter names (#8285)
This wasn't possible prior to #8280, which disabled pyright's reportSelfClsParameterName check
2022-07-12 22:40:48 +01:00
Alex Waygood 6348a58b8b Import Match and Pattern from re, not typing (#8277) 2022-07-12 15:32:48 +02:00
Alex Waygood 27db37240a Remove files that only exist on <=3.6, update a few comments (#8273) 2022-07-12 09:12:32 +02:00
Alex Waygood 78d96cd17e Drop support for Python 2 (#8272) 2022-07-12 09:08:56 +02:00
Alex Waygood edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood fbddd2c4e2 stdlib: enforce CamelCase for type alias names (#8255) 2022-07-07 17:45:23 +02:00
Alex Waygood abea36c069 Improve configparser alias names (#8254) 2022-07-07 16:17:09 +01:00
Alex Waygood 9ccf4589a0 Fix various TypeAlias issues (#8248) 2022-07-07 17:48:44 +05:30
Alex Waygood 850bc78a45 Improve SQLAlchemy type aliases (#8252)
* Remove `sqlalchemy.dbapi` (in favor of `_typeshed.dbapi`).
* Don't re-export mypy imports from `sqlalchemy.ext.mypy.*`.
2022-07-07 14:11:08 +02:00
Alex Waygood 42c5633bf6 Improve tqdm.contrib.logging context managers (#8251) 2022-07-07 10:28:28 +01:00
Alex Waygood fffb25201a Delete some works of fiction (#8247) 2022-07-06 22:49:18 +05:30
Alex Waygood 73974e974d Improve warnings.catch_warnings (#8229) 2022-07-04 17:05:21 +02:00
Alex Waygood 8ef6602e25 Third-party stubs: audit more Callable[<parameters>, Any] annotations (#8233) 2022-07-04 10:29:47 +02:00
Alex Waygood 0cff7fea71 http.cookiejar.MozillaCookieJar.header does not exist in 3.10+ (#8228) 2022-07-03 09:42:14 -07:00
Alex Waygood e19073e871 Add a tiny bit more special-casing for sum (#8231) 2022-07-02 20:05:56 +01:00
Alex WaygoodandShantanu a2e8346d9a Improve multiprocessing stubs (#8202)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-07-01 23:50:39 +05:30
Alex Waygood f69f711d5a subprocess.Popen: __new__ -> __init__ (#8203) 2022-06-28 20:11:03 +02:00
Alex Waygood 802f606a3b Improve turtle callbacks (#8200) 2022-06-28 14:30:50 +02:00
Alex Waygood 79556345ac Improve boto callbacks (#8201) 2022-06-28 14:30:26 +02:00
Alex Waygood 5b44454cf8 Improve inspect callbacks (#8189) 2022-06-27 07:07:09 -07:00
Alex Waygood 3e27458323 Improve xmlrpc.client callbacks (#8188) 2022-06-27 13:22:33 +01:00
Alex Waygood 208d8e1ec2 Fix assertAlmostEqual regression on mixed numeric types (#8137) 2022-06-27 08:57:36 +02:00
Alex Waygood 7c3b13ba4f asyncio.sslproto: _SSLPipe and several SSLProtocol attributes no longer exist on py311 (#8186) 2022-06-27 08:12:01 +02:00
Alex Waygood 8b3b6bf7cd stdlib: Audit Callable[<parameters>, None] annotations (#8187) 2022-06-27 08:08:28 +02:00
Alex Waygood ca44b893e3 multiprocessing: audit callback annotations (#8178) 2022-06-26 13:15:26 +01:00
Alex Waygood 74bd0d962b Third-party stubs: audit Callable[<parameters>, None] annotations (#8175) 2022-06-26 13:56:19 +02:00
Alex Waygood 49cdaa41db JACK-Client: audit callback annotations (#8177)
The returned values from these functions are all ignored at runtime.
2022-06-26 11:36:28 +01:00
Alex Waygood f812d71ffa Improve errno stubs on Windows and MacOS (#8142) 2022-06-26 08:29:02 +05:30
Alex Waygood ca2f83a4cf typing_extensions: harmonise __all__ with __all__ at runtime (#8165) 2022-06-25 19:16:23 -07:00
Alex Waygood f5f37fed3a Upgrade pytype (#8164) 2022-06-25 18:15:43 +01:00
Alex Waygood b550d463c7 Fix stubtest failures on SQLAlchemy (#8148) 2022-06-25 11:34:47 +05:30
Alex Waygood 64d91ef414 mypy_test.py: Add command-line argument to enable selecting which parts of the test to run (#8143) 2022-06-23 10:21:32 -07:00
Alex Waygood 610d2908bd mypy_test.py: Allow passing in multiple platforms from the command line (#8138) 2022-06-22 20:13:01 +01:00
Alex Waygood 15a17d1301 mypy_test.py: Add argument validation, improve type hints (#8135) 2022-06-22 18:03:29 +01:00
Alex Waygood 09141ec3dc mypy_test.py: Fix argument-parsing for --python-version (#8134)
* mypy_test.py: Fix argument-parsing for `--python-version`

* Bump min version required in the README
2022-06-22 15:08:56 +01:00
Alex Waygood a527bf27d5 Run mypy on the scripts directory in CI (#8133) 2022-06-22 14:13:38 +01:00
Alex Waygood 89f4dee452 Improve several __hash__ methods (#8128) 2022-06-22 11:58:00 +01:00
Alex Waygood 8826d3a36f Rename some confusingly named type aliases (#8129) 2022-06-21 20:51:05 +01:00
Alex Waygood 3fe1f5d6c4 requests, regex: use re-exports instead of assignments in a few places (#8127) 2022-06-21 08:20:13 -07:00
Alex Waygood 67f377898b Add process_group argument to subprocess.{run, call, check_call, check_output} (#8125) 2022-06-21 07:44:20 -07:00
Alex Waygood 0740d1c48e asyncio.gather: Add overload for if no positional arguments are provided (#8126) 2022-06-21 15:31:40 +01:00
Alex Waygood a01e0260b3 Add pipesize argument to subprocess.{run, call, check_call, check_output} (#8124) 2022-06-21 05:59:26 -07:00
Alex Waygood cad42c7c7b asyncio.gather: Remove default values for return_exceptions: bool overloads (#8123) 2022-06-21 05:57:06 -07:00
Alex Waygood f9e24680c3 Add new-in-3.9 parameters to subprocess.{run, call, check_call, check_output} (#8071) 2022-06-21 04:35:50 -07:00
Alex Waygood c6de37df53 Overhaul socket stubs on Windows and MacOS (#8106)
Reduce the `socket` allowlists for these platforms to a handful of missing constants
2022-06-20 20:11:50 +01:00
Alex Waygood 538621e91b unittest.case: tighter annotations for various assertions (#8077) 2022-06-20 18:49:57 +02:00
Alex Waygood bae4fd2209 Upgrade pyright (#8110) 2022-06-20 17:07:43 +01:00
Alex Waygood 411d85feeb socket.AddressFamily: Fix AF_LINK (#8103)
Slipped through the net in #8099
2022-06-19 09:10:33 +01:00
Alex Waygood 6b0c8df9ec Upgrade pyright, improve pyright config files (#8072) 2022-06-16 18:50:50 +01:00
Alex Waygood a2ef47660a Fix TypeVars in beautifulsoup and SQLAlchemy (#8087) 2022-06-16 17:34:27 +02:00
Alex Waygood 43f923b6c2 protobuf: Delete some __new__ and __init__ methods (#8088) 2022-06-16 17:10:14 +02:00
Alex Waygood 4967c8bc12 redis: fix more unconstrained TypeVars (#8084) 2022-06-15 10:14:13 -07:00
Alex Waygood 5fa31e6759 Remove mypy error codes from the test_cases directory (#8083) 2022-06-15 15:31:45 +01:00
Alex Waygood 01d5e28ff7 Fix miscellaneous invalid TypeVar usages (#8074) 2022-06-14 08:48:41 -07:00
Alex Waygood 4941ac0263 Use the Any trick for xml.etree.ElementTree.getroot() (#8069)
Closes #7770
2022-06-14 18:31:19 +03:00
Alex Waygood 5add91d6bb unittest: Improve self.assert(Not)AlmostEqual(s) (#8066) 2022-06-14 18:24:51 +03:00
Alex Waygood 7de1ed9589 cachetools: Fix invalid TypeVar usage (#8073) 2022-06-14 06:39:45 -07:00
Alex Waygood 60c2733ca8 subprocess.(check_)call: add text argument new in 3.7 (#8070) 2022-06-14 01:54:16 +01:00
Alex Waygood 1828ba2045 builtins.sum: Items in the iterable must support addition with int if no start value is given (#8000) 2022-06-13 11:25:38 +01:00
Alex Waygood 67828bd598 xml.etree.ElementTree.Element: remove inheritance from MutableSequence (#8056) 2022-06-13 12:22:28 +02:00
Alex Waygood 1be5918baa Use _typeshed.IdentityFunction more consistently (#8063) 2022-06-12 16:56:14 -07:00
Alex Waygood 033516d39f flake8 config: Ignore more error codes in .py files (#8065)
black fixes these for us in `pre-commit.ci`.
2022-06-12 12:04:38 -07:00
Alex Waygood 1aa5663f9e Add __setattr__ to logging.LogRecord (#8064) 2022-06-12 12:04:22 -07:00
Alex Waygood 55eb19d1bd Improve csv.DictReader (#8061) 2022-06-12 17:02:05 +03:00
Alex Waygood b5802d0bbe Add tkinter._test (#8062)
Fixes #7903
2022-06-12 16:58:39 +03:00
Alex WaygoodandAkuli 16281bb04f Improve turtle.Vec2D (#8058)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-06-12 15:53:14 +03:00
Alex Waygood 45b9e60d13 dateparser: Remove redundant import of _typeshed.Self (#8041) 2022-06-08 21:02:14 +01:00
Alex Waygood c449ddde56 Remove stubs for characteristic (#8040) 2022-06-08 20:18:13 +01:00
Alex Waygood e7a5b7a762 Fix various __all__-related errors and omissions (#8031) 2022-06-07 23:29:55 +01:00
Alex Waygood 591593c85f Simplify __all__ for modules beginning with 'm' to 't' (#8028) 2022-06-07 20:14:15 +01:00
Alex Waygood b88ea4a499 Simplify __all__ for unittest and xml.etree (#8029) 2022-06-07 12:03:52 -07:00
Alex Waygood e88a182573 Simplify __all__ definitions in modules beginning with 'a' to 'l' (#8026) 2022-06-07 15:40:48 +02:00
Alex Waygood 15ad2657db Upgrade pytype (#8025)
Unblocks #7865
2022-06-07 12:13:05 +01:00
Alex WaygoodandJelle Zijlstra 9db96967cc asyncio.sslproto: More updates for py311 (#8022)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-06-06 15:12:22 -07:00
Alex Waygood 7322acbb97 jsonschema: mark type alias explicitly (#8024) 2022-06-06 14:44:46 -07:00
Alex Waygood 43a9ab08d7 Always use TypeAlias when assigning to Any (#8021) 2022-06-05 18:16:20 -07:00
Alex Waygood 0ce825b5a8 Add unittest features new in Python 3.11 (#8020)
python/cpython@086c6b1
2022-06-04 16:27:52 +01:00
Alex Waygood 8a98e5a075 check_new_syntax.py: Fix bug in visit_AnnAssign (#8017) 2022-06-03 19:12:11 +02:00
Alex Waygood acc0167dc1 Fix several new-in-3.11 stubtest errors (#7973) 2022-06-02 18:07:38 -07:00
Alex Waygood 6355cba923 Python 3.11: re.TEMPLATE is back in beta 2 (#8007) 2022-06-01 14:50:37 +02:00
Alex Waygood a7ff433fc3 CONTRIBUTING.md: Fix broken link (#7994) 2022-05-30 16:36:06 -07:00
Alex WaygoodandShantanu fa85367fc9 CONTRIBUTING: improve docs on running tests locally (#7992)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-05-30 15:44:13 -07:00
Alex Waygood d4eba8b5ce builtins.sum: Add overload for bool special case (#7975)
Closes #7974
2022-05-28 11:14:10 -07:00
Alex Waygood 8e8176b24c mypy_test.py: Skip Flask-SQLAlchemy (#7977) 2022-05-28 10:18:57 -07:00
Alex Waygood ceccc655db Introduce _typeshed.GenericPath and _typeshed.AnyStr_co (#7970) 2022-05-27 19:02:00 +01:00
Alex Waygood c05731c46f tempfile.pyi: readability improvements (#7959)
The name `_DirT` implies that it is a `TypeVar`, but it isn't; it's a generic `TypeAlias` that can be parameterised with a `TypeVar`. Rename it to just `_Dir` instead.

Also, use aliases instead of repeating incredibly long Literal annotations six times.
2022-05-27 08:52:44 +01:00