Commit Graph
100 Commits
Author SHA1 Message Date
Alex Waygood 3e5808a990 Bump flake8-pyi and pytype test dependencies (#8656) 2022-08-31 12:20:11 +01:00
Alex Waygood 601700d1a5 Improve some tkinter unions (#8655) 2022-08-31 13:05:51 +03:00
Alex Waygood 86a34c5bd6 typecheck_typeshed.py: Make dir command-line argument positional-only (#8646) 2022-08-31 09:14:53 +01:00
Alex Waygood 8b222200e0 fpdf2: Remove redundant str | Literal['DEPRECATED'] union (#8650) 2022-08-30 19:54:52 +01:00
Alex Waygood b417d5796d Run flake8-noqa in CI (#8641) 2022-08-29 21:06:47 +01:00
Alex Waygood c72c9a6c96 typed_ast.ast3: arguments.kw_defaults should be list[expr | None] (#8645)
```python
>>> from typed_ast import ast3
>>> print(ast3.dump(ast3.parse('def foo(*, arg: int) -> None: ...')))
Module(body=[FunctionDef(name='foo', args=arguments(args=[], vararg=None, kwonlyargs=[arg(arg='arg', annotation=Name(id='int', ctx=Load()), type_comment=None)], kw_defaults=[None], kwarg=None, defaults=[]), body=[Expr(value=Ellipsis())], decorator_list=[], returns=NameConstant(value=None), type_comment=None)], type_ignores=[])
```

This bug was discovered in https://github.com/python/mypy/pull/13547
2022-08-29 14:44:48 +01:00
Alex Waygood c0f27e39f9 Upgrade pytype to 22.8.23 (#8644) 2022-08-29 14:07:11 +01:00
Alex Waygood bc26a98bd7 create_baseline_stubs.py: Modernize a few type annotations (#8642) 2022-08-29 13:49:00 +01:00
Alex Waygood e2211cb420 Delete some unused # noqa comments (#8639) 2022-08-29 12:56:06 +01:00
Alex Waygood c8a679657b Delete scripts/update-stubtest-allowlist.py (#8606) 2022-08-29 13:50:26 +02:00
Alex Waygood 1b6cda86d4 Alphabetise items in requirements-tests.txt (#8635) 2022-08-28 07:59:17 -07:00
Alex Waygood d91e5f0eff Further enhance check_consistent.py (#8604) 2022-08-26 07:50:26 -07:00
Alex Waygood 8cf125d80d flake8 config: fix typo (#8626)
Accidentally introduced in #8612
2022-08-26 11:55:47 +01:00
Alex Waygood 1c56148ce9 mypy_test.py: Remove --dry-run option (#8611)
Cf #8139.
2022-08-25 14:23:00 +02:00
Alex Waygood 0f1d1f16b4 isort: don't skip stdlib/venv (#8607) 2022-08-24 15:48:27 -07:00
Alex Waygood 15f74295d2 Add aiohttp and tomlkit to requirements-tests.txt (#8605) 2022-08-24 23:08:54 +01:00
Alex Waygood 1e33759f09 cryptography: Add some missing @abstractmethod decorators (#8598) 2022-08-23 11:38:08 -07:00
Alex Waygood e160324ba7 six: Fix incorrect type[type[Any]] annotation (#8599)
Mypy will (correctly, I think) start flagging `type[type[Any]]` as an illegal annotation when mypy 0.980 comes out. Let's fix it now, before it comes out.
2022-08-23 11:26:10 -07:00
Alex Waygood 875f0ca7fc mypy_test.py: Move type-checking of our tests and scripts into a different test (#8587) 2022-08-22 17:16:03 +01:00
Alex Waygood 976fdae300 xml stubs: Any -> Incomplete (#8576) 2022-08-22 16:42:37 +01:00
Alex Waygood c2966bc5ed multiprocessing.reduction: Any -> Incomplete (#8585) 2022-08-21 17:43:55 -07:00
Alex Waygood 9f05e9ff58 Improve classes returned from OrderedDict.{keys(), items(), values()} (#8552) 2022-08-20 22:21:39 +01:00
Alex Waygood 38bc0ec0e6 mypy_test.py: simplify argument parsing (#8577) 2022-08-20 21:32:17 +01:00
Alex Waygood c4ca110c5c README: Add a link to https://typing.readthedocs.io (#8575) 2022-08-20 09:40:57 -07:00
Alex Waygood 8a326dc9ec Remove NoReturn overloads from pow() (#8568) 2022-08-19 11:15:07 -07:00
Alex Waygood 2c052651e9 Normalise use of Never vs NoReturn (#8549) 2022-08-17 21:53:40 +01:00
Alex Waygood 5b47f13a99 Add _threading_local.local.__delattr__ back to the stub (#8526) 2022-08-15 11:56:31 +02:00
Alex Waygood cf0b3a2596 Improve .keys(), .values(), .items() methods for TypedDicts (#8532) 2022-08-12 20:02:43 -07:00
Alex Waygood 1ec57121e3 Unpin stubtest from 3.10.5 (#8523) 2022-08-12 10:01:26 +02:00
Alex Waygood a92da58328 Add @type_check_only to two fictional classes in builtins.pyi (#8531) 2022-08-11 11:55:07 +01:00
Alex Waygood 556f6a10f6 Enable flake8-pyi's Y034 check in stdlib/typing.pyi (#8530) 2022-08-11 10:57:31 +02:00
Alex Waygood 5a24bf8e1f setuptools: delete _distutils.command.check.HAS_DOCUTILS (#8529)
Fixes #8527
2022-08-11 07:17:00 +01:00
Alex Waygood a0d1f466fb decimal.Context: Improve comments (#8525) 2022-08-10 19:53:47 +01:00
Alex Waygood f2283d519e Fix stubtest failures on SQLAlchemy (#8524) 2022-08-10 11:48:46 -07:00
Alex Waygood c87ccce37e Remove a few unused TypedDicts (#8522) 2022-08-10 18:56:14 +01:00
Alex Waygood 7eaedd44dd Add missing TypedDict methods and ClassVars (#8512) 2022-08-10 10:29:40 +01:00
Alex Waygood c68bcc7e69 Temporarily pin stubtest to 3.10.5 (#8511) 2022-08-09 13:55:00 +02:00
Alex Waygood 892796a794 Remove, move or # noqa more TypeAlias declarations (#8450) 2022-08-05 13:03:19 +01:00
Alex Waygood 1dc1c91429 io.IOBase: correct metaclass (#8468)
`io.IOBase` has `ABCMeta` as the metaclass at runtime: https://github.com/python/cpython/blob/75a6441718dcbc65d993c9544e67e25bef120e82/Lib/io.py#L71

But not currently in the stub. This is causing an unexpected stubtest failure for a `urllib3` PR here: https://github.com/python/typeshed/runs/7633083101?check_suite_focus=true
2022-08-02 09:20:07 -07:00
Alex Waygood df4618ef2d Upgrade pycln and flake8-pyi (#8464) 2022-08-02 08:43:02 +01:00
Alex Waygood 59a9621554 test_cases README: fix typos (#8453)
Both introduced in #8445
2022-07-31 23:11:13 +01:00
Alex Waygood 4414246a15 Clean up a few Python 2 remnants (#8452) 2022-07-31 19:19:18 +01:00
Alex Waygood 87fc724cef ctypes: pointer is a function, not a class (#8446) 2022-07-31 15:29:13 +02:00
Alex Waygood ea7bbbdad7 Move Match and Pattern to re.pyi; move ContextManager protocols to contextlib.pyi (#8447) 2022-07-31 15:27:47 +02:00
Alex Waygood 935ac9ca9e test_cases: Improve README (#8445) 2022-07-30 18:40:56 +01:00
Alex Waygood fdeb216547 Remove or move several TypeAlias declarations (#8444) 2022-07-30 15:28:52 +01:00
Alex Waygood 553700e355 Move some protocol definitions closer to their usage sites (#8436) 2022-07-29 06:26:27 -07:00
Alex Waygood a9f6632d1b multiprocessing.reduction: improve recvfds and recv_handle (#8422) 2022-07-28 17:05:08 +01:00
Alex Waygood 26d09359cf multiprocessing.resource_sharer: remove unused TypeAlias (#8424) 2022-07-28 17:43:36 +02:00
Alex Waygood 78e0b3cfca Stubtest: allowlist all of distutils on 3.11 (#8411)
Fixes #8410
2022-07-27 20:27:38 +01:00
Alex Waygood 62cde01365 Upgrade flake8-pyi to 22.7.0 (#8377) 2022-07-24 03:20:35 +01:00
Alex Waygood 23c4b124a6 Stubtest allowlists: put all the fake __iter__ methods together (#8368) 2022-07-22 18:08:13 +01:00
Alex Waygood eca5549ee1 CI: Use macos-latest for stubtest (#8353) 2022-07-21 16:52:41 +02:00
Alex Waygood 5bc9554573 stdlib/VERSIONS: fix crusty comment (#8347)
Resolves #8310
2022-07-20 18:59:01 +02:00
Alex Waygood d1e80a724a Add some missing Windows constants (#8346) 2022-07-20 17:45:36 +01:00
Alex Waygood a57e182608 enum: Correct IntFlag mro on 3.11+ (#8334) 2022-07-19 21:47:37 +02:00
Alex Waygood 6903041744 Use CamelCase for type aliases in xml.etree.ElementPath.pyi (#8335) 2022-07-19 12:04:43 -07:00
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