Commit Graph

576 Commits

Author SHA1 Message Date
Alex Waygood
b093c90a94 Use TypeAlias for type aliases where possible, part II (#7667) 2022-04-20 20:02:47 +01:00
Andrey
4a701642f2 Add typing for __iter__ in sqlalchemy.orm.Query (#7666) 2022-04-20 10:55:12 +01:00
Alex Waygood
819900fa55 Python 3 stubs: use str instead of typing.Text (#7638) 2022-04-16 15:47:00 +01:00
Alex Waygood
653f2c6ba4 Third-party stubs: import from collections.abc where possible (#7637) 2022-04-16 14:52:57 +01:00
Alex Waygood
66bea8ca48 Use imports instead of TypeAliases in a couple places (#7634)
Fixes #7632
2022-04-16 01:38:59 -07:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood
c0e6dd3f3f Use str instead of typing.Text (#7629) 2022-04-16 00:47:42 +02:00
Jukka Lehtosalo
ce88976c0d Add back six.moves.http_cookies.Morsel (#7617) 2022-04-13 16:52:29 +02:00
Jukka Lehtosalo
f888995239 Add back six.moves.configparser.Error (#7616) 2022-04-13 14:01:03 +02:00
matt-slack
6573761324 Add stubs for Python-Jose (#7613) 2022-04-12 19:08:23 +02:00
Jukka Lehtosalo
75bcb07d06 Add missing definitions to six.moves.http_client (#7615)
These were removed as a side-effect of #7327, which added
`__all__` to `http.client`. I checked that all the definitions
are present at runtime via `six.moves.http_client`.
2022-04-12 06:51:02 -07:00
Sebastian Rittau
636a7e8b37 Update bleach stubs to version 5 (#7612) 2022-04-11 17:48:55 -07:00
kasium
354787f6e0 Add stubs for stdlib-list (#7608) 2022-04-08 13:05:48 -07:00
Bao
79c654ef43 psycopg2: correct return type (#7607)
Fixes the return type of `psycopg2.cursor.fetchone()` to match the psycopg2 code:

1d3a89a0bb/psycopg/cursor_type.c (L647-L651)
1d3a89a0bb/psycopg/cursor_type.c (L748-L786)

It also matches the [psycopg2 documentation](https://www.psycopg.org/docs/cursor.html?highlight=copy_from#cursor.fetchone) as well as the [DB-API](https://peps.python.org/pep-0249/#fetchone)
2022-04-07 15:36:26 -07:00
hasier
21171f1cb9 SQLAlchemy improvements for Operators (#7604) 2022-04-07 19:45:27 +02:00
hasier
754f421990 SQLAlchemy improvements for generative methods (#7603) 2022-04-07 13:06:46 +02:00
Hans Aarne Liblik
71d80efa43 Update pyVmomi stubs (#7599)
* Add generic base class `DynamicData`
* Add missing `key` prop to `OptionValue` 
* Fix `MethodFault` not inheriting from `Exception`
* Fix `RetrieveOptions` default `maxObjects` type and default
2022-04-06 14:58:23 +02:00
Alex Waygood
1ceb486b75 Replace Union with union operator (#7596) 2022-04-05 23:07:31 +02:00
Sebastian Rittau
3941e959ca Update google-cloud-ndb stubs to 1.11 (#7593) 2022-04-05 06:58:02 -07:00
Alex Waygood
85aec034ae Mark many attributes as read-only properties (#7591) 2022-04-05 08:37:24 +02:00
Alex Waygood
ec27c00ca2 Third-party stubs: Improve several __exit__ methods (#7575) 2022-04-01 08:03:12 -07:00
Sebastian Rittau
4c9dc43c87 Update SQLalchemy to 1.4.34 (#7573)
Closes: #7572
2022-04-01 14:22:00 +01:00
Alex Waygood
ae6ff79c0e flake8 config: remove line that exists only for Python-2 checking (#7570) 2022-04-01 08:07:16 +02:00
Hans Aarne Liblik
e8fe316a74 Add a few classes to vmodl and vmodl.fault (#7565) 2022-03-29 22:07:25 +02:00
Alex Waygood
a3245db63c Remove unneeded # noqa comments, fix broken # noqa comments (#7561) 2022-03-28 23:17:44 +02:00
Sebastian Rittau
c41034c354 passlib: Annotate various handler methods and fields (#7521)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-26 20:53:05 -07:00
Kalle Møller
9aa64fdc22 requests: Update adapters.pyi (#7544)
The cert can be
* A string / bytes which is a path to a certfile
* A tuple with two string / bytes, where the first is the certfile and the second is a keyfile
* None (optional)

The tuple could be anything indexable, but there are strict requirement to actualle have two items, don't know if there is something more generic

See https://github.com/psf/requests/blob/main/requests/adapters.py#L242-L248
2022-03-26 20:41:25 -07:00
dset0x
a018110980 DateTimeRange: __contains__ accepts datetime.datetime (#7541) 2022-03-24 11:39:19 +01:00
Sebastian Rittau
251dd52b57 Remove backports_abc third-party package (#7533)
The last release was in 2016 and it's not required in any currently
supported Python 3 version.
2022-03-22 11:43:59 -07:00
kasium
dd1265c0e6 Mark pre/post tasks in invoke tasks as iterable (#7531) 2022-03-22 16:06:22 +01:00
kasium
108c3ab710 Fix wrong return type of invoke decorator (#7536)
Closes #7530
2022-03-22 14:30:51 +01:00
Jelle Zijlstra
fa9074366b Revert "Remove google/__init__.pyi (#6106)" (#7522)
This reverts commit a11a6643a7.
2022-03-21 19:49:00 +01:00
kasium
7d77e9c5c1 Fix invoke task decorator (#7511)
The decorator can be called with and without (). The current types only consider the first case
2022-03-20 16:13:02 -07:00
Nipunn Koorapati
a11a6643a7 Remove google/__init__.pyi (#6106)
Since google is a namespace package, it won't have an init.
Depends on https://github.com/typeshed-internal/stub_uploader/pull/33
2022-03-20 14:41:16 -07:00
Jelle Zijlstra
b7d129f727 PEP 604: Remove some more uses of Union/Optional (#7515)
The following patterns still break mypy:

1. `type[]` at top level fails
2. `tuple[T1, T2]` at top level fails (but `tuple[T1, ...]` is fine)
3. `T1 | Callable[..., T2 | T3]` fails, but only <=3.9

This PR cleans up usage of `Union` and `Optional` outside these patterns.
2022-03-19 08:23:00 -07:00
Alex Waygood
1acc8f3bd6 Use PEP 604 syntax wherever possible, part II (#7514)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-03-19 14:27:35 +00:00
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
Jelle Zijlstra
d9f1f7b81f pytz: utcoffset only returns None if dt is None (#7510) 2022-03-19 08:19:09 +00: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
Myoungdo Park
830b57f8f8 Add stubs for whatthepatch (#7492)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-03-16 23:38:41 +02: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
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
8134752ad8 requests stubs are not Python 2-compatible (#7483) 2022-03-13 13:06:34 +01:00