Commit Graph

5957 Commits

Author SHA1 Message Date
Alex Waygood
340c6c97ed Add mypy error codes to type: ignores, remove unused ignores (#7504)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-19 13:10:00 +00:00
Alex Waygood
4308915e06 Make __hash__ a ClassVar for several classes where it is set to None (#7485) 2022-03-19 05:59:10 -07:00
Jelle Zijlstra
d9f1f7b81f pytz: utcoffset only returns None if dt is None (#7510) 2022-03-19 08:19:09 +00:00
Alex Waygood
5c44ae4f8c Improve various signatures that shouldn't be async def, but currently are (#7491)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-03-18 20:54:39 -07:00
Marc Mueller
37a981920f Use TypeVar for pkgutil.extend_path (#7473) 2022-03-18 20:44:38 -07:00
Jelle Zijlstra
4d23919200 Add typing.TypeVarTuple, Unpack, assert_type (#7501)
python/cpython#31021 and python/cpython#30843.
2022-03-18 18:03:45 +00:00
Sebastian Rittau
50107e6e2b 'Inactive' -> 'former' consistently (#7512) 2022-03-18 06:01:04 -07:00
Alex Waygood
e8286e7048 Use PEP 604 syntax in non-autogenerated protobuf stubs (#7506) 2022-03-17 11:34:31 +00:00
kasium
061ddad8e3 Add annotations to invoke.tasks (#7502) 2022-03-17 11:13:03 +01:00
Jelle Zijlstra
ba475a04c3 multiprocessing: args can be any Iterable (#7500)
https://github.com/python/cpython/blob/main/Lib/multiprocessing/process.py#L91
2022-03-17 01:44:25 +00:00
Myoungdo Park
830b57f8f8 Add stubs for whatthepatch (#7492)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-03-16 23:38:41 +02:00
Alex Waygood
ec8f51726f Unpin pyright-action (#7499)
The issues that broke typeshed's CI have been fixed by e7c2cbabca
2022-03-16 16:21:05 +00:00
Sebastian Rittau
108b6fb091 pyright: Don't report incompatible overrides (#7498)
These overrides are inherited from the implementation and are out of
typeshed's control.
2022-03-16 16:20:06 +01:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Alex Waygood
15e21a8dc1 Use pyright 1.1.230 in CI, temporarily pin pyright-action to 1.0.4 (#7495)
* Upgrade pyright to 1.1.230
* Add `type: ignore`s for new pyright checks regarding multiple inheritance
* Temporarily pin pyright-action to 1.0.4, as changes made in 1.0.5 break typeshed's CI

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-16 14:24:55 +00:00
Anders Kaseorg
b78f0c21ba psycopg2: Accept Composable in place of query string (#7494)
https://www.psycopg.org/docs/sql.html#psycopg2.sql.Composable
“Composable objects can be passed directly to execute(),
executemany(), copy_expert() in place of the query string.”

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2022-03-15 20:47:30 -07:00
Sebastian Rittau
fdc5863337 Use stubtest 0.941 (#7490) 2022-03-15 00:37:34 -07:00
Stephen Rosen
134f047402 jsonschema: mark schemas as Mapping[str, Any] (#7489) 2022-03-14 17:11:33 +01:00
Sebastian Rittau
1cc31cd470 passlib: Annotate pbkdf2_sha* (#7486) 2022-03-14 08:55:37 -07:00
Stephen Rosen
a3027d3b96 jsonschema: RefResolver.referrer is a dict[str, Any] (#7487) 2022-03-14 16:27:08 +01:00
Joseph Young
860db6f6c4 sqlalchemy: Annotate (Async)Session.__(a)enter__ (#7488) 2022-03-14 15:15:32 +00:00
Alex Waygood
2f338ce077 Further improve mypy_test.py (#7484)
* Run mypy on the 3.11 stdlib in CI, as a regression test for https://github.com/python/mypy/issues/12220
* Correct the docstring at the top of the file following the changes made in #7478
* Stop the test from crashing when run locally if there's an extra file/folder in the stubs directory.
2022-03-13 19:58:30 +00:00
Jelle Zijlstra
fa332220b7 Fix mypy test (#7478)
* Fix `mypy_test.py` so that it actually tests the third-party stubs
* Upgrade to mypy 0.940
* Skip running mypy on `SQLAlchemy` stubs for now, to workaround a mypy crash.

Because we didn't set mypy's clean_exit parameter, it was exiting immediately after checking the stdlib, meaning `mypy_test.py` wasn't checking the third-party stubs at all.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-13 13:01:14 +00:00
Jelle Zijlstra
3e3cc2a6d6 dict.pop: Remove default for second argument (#7481)
The first overload takes care of the case where there is only one argument, so there should be no default in the second overload.
2022-03-13 13:11:35 +01:00
Alex Waygood
8134752ad8 requests stubs are not Python 2-compatible (#7483) 2022-03-13 13:06:34 +01:00
Alex Waygood
d3df6da103 parsimonious: re.Match does not exist in Python 3.6 (#7482)
It has to be imported from `typing` in <3.7.
Refs https://github.com/python/typeshed/pull/7478.
2022-03-13 00:23:31 -08:00
Jelle Zijlstra
bd449c983a urllib3: stubs are not Python 2 compatible (#7480)
They use http.client, which is Python 3-only. Another catch from #7478.
2022-03-13 07:09:01 +00:00
Jelle Zijlstra
c89236d1cf passlib: fix MutableMapping import (#7479)
Found by #7478
2022-03-12 19:18:48 -08:00
Joseph Young
3a9abf850a Stubs for parsimonious (#7477) 2022-03-12 18:43:07 -08:00
Andrej Shadura
a5ddf0bf0d Add xmltodict (#7472)
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
2022-03-11 12:19:51 +01:00
Jelle Zijlstra
9c50fe7b64 Fix overly precise typing.NewType signature (#7474)
`type` is incorrect because `NewType` can also accept another `NewType`: https://peps.python.org/pep-0484/#newtype-helper-function

The return type was also wrong; pre-3.10 `NewType()` doesn't return a type object.
2022-03-11 06:35:45 +00:00
Aaron Kau
a3e62d56fc change Change IO/IOBase.__exit__ return type to None (#7471) 2022-03-10 15:57:05 +01:00
Aaron Kau
bf2049ef18 Change TemporaryFileWrapper.__exit__ return type to None (#7470)
For context we found this from quora/pyanalyze#496, which makes pyanalyze stricter about context managers that may swallow exceptions. tempfile._TemporaryFileWrapper.__exit__ returns whatever its underlying file returns (https://github.com/python/cpython/blob/3.6/Lib/tempfile.py#L502), and file objects don't tend to return anything from __exit__.
2022-03-09 19:34:24 -08:00
Alex Waygood
9a1f5fb06c Modernize syntax in various stubs (#7469)
Use `str` and `contextlib.AbstractContextManager` instead of `typing.Text` and `typing.ContextManager`.
2022-03-09 21:23:26 +00:00
Sebastian Rittau
cdb573b398 Remove explicit inheritance from object (#7468) 2022-03-09 19:43:44 +01:00
Sebastian Rittau
6df2274a41 Inactive maintainers policy (#7467)
Closes: #7449
2022-03-09 19:28:05 +01:00
Sebastian Rittau
c3907ab26b Remove Python 2 support from some third-party distributions (#7466)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-09 20:19:22 +02:00
Alex Waygood
4e87b9058f Improve collections.Counter stub (#7464) 2022-03-09 12:22:28 +02:00
Patrick Rauscher
c987c78077 Remove ClassVar from SSLContext.ssl{object,socket}_class (#7465)
These attributes have class-level defaults, but the docs explicitly state that it's OK to override them on instances.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-09 08:53:18 +00:00
Shantanu
9c737f1326 Re-enable stubtest on SQLAlchemy (#7456) 2022-03-09 07:34:12 +01:00
Akuli
f9cb7c3ed4 Use Literal for statistics.quantiles() (#7463)
I'm going to merge; I think this is consistent with what we've done with e.g. the `byteorder` argument for `int.from_bytes` :)
2022-03-08 21:38:31 +00:00
Akuli
6c967d4202 Update cachetools to 5.0.0 (#7455)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-03-08 19:20:22 +00:00
Sebastian Rittau
889164cb0c psycopg2: Annotate cursor execute* and dunder methods (#7460) 2022-03-08 08:13:19 -08:00
Alex Waygood
db6f912c77 Improve mmap.mmap.__enter__ (#7461)
It returns `Self` at runtime, not `mmap.mmap`, so inheriting from `AbstractContextManager` doesn't really do anything for us.
2022-03-08 07:47:56 -08:00
Bas van Beek
70988f1811 Widen the cmdclass parameter of setuptools.setup (#7458) 2022-03-08 15:07:44 +02:00
Henry Schreiner
967f83db09 rlcompleter: add attr_matches, global_matches (#7453)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-08 00:07:58 +00:00
Alex Waygood
f4ae363b56 stdlib: correct many pos-or-kw arg names in dunder methods (#7451) 2022-03-07 16:40:03 +01:00
Alex Waygood
626ccdaee2 Add @AlexWaygood as a maintainer (#7450) 2022-03-07 15:08:19 +00:00
Akuli
30a424c661 Finish renaming stubtest.yml to daily.yml (#7448) 2022-03-07 11:09:24 +02:00
Jelle Zijlstra
675de720d6 Add some missing items to sys.pyi and types.pyi (#7447) 2022-03-07 08:22:08 +01:00