Commit Graph

1262 Commits

Author SHA1 Message Date
Alex Waygood
8b222200e0 fpdf2: Remove redundant str | Literal['DEPRECATED'] union (#8650) 2022-08-30 19:54:52 +01:00
github-actions[bot]
9e69627501 Bump prettytable to 3.4.* (#8621) 2022-08-29 13:37:50 -07: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
e2211cb420 Delete some unused # noqa comments (#8639) 2022-08-29 12:56:06 +01:00
Nikita Sobolev
d3cded7fc6 redis: Add _Encodable type alias (#8638) 2022-08-29 13:38:22 +02:00
Nikita Sobolev
481027e194 redis: Improve ClusterPubSub types (#8627) 2022-08-27 16:13:46 +01:00
github-actions[bot]
6114fb54c0 [stubsabot] Bump tree-sitter-languages to 1.4.* (#8623) 2022-08-26 10:23:59 +01:00
Nipunn Koorapati
7beaebff40 Bump to mypy-protobuf 3.3.0 (#8612)
* Bump to mypy-protobuf 3.3.0

* Remove some ignores for formatting
2022-08-26 07:24:11 +01:00
github-actions[bot]
ef25fc6c9b [stubsabot] Bump jsonschema to 4.14.* (#8619) 2022-08-25 19:36:01 -07:00
github-actions[bot]
e93af9b333 [stubsabot] Bump setuptools to 65.3.* (#8620) 2022-08-25 19:34:32 -07:00
github-actions[bot]
d6eb817b31 [stubsabot] Bump flake8-bugbear to 22.8.23 (#8622) 2022-08-25 19:33:22 -07:00
Stephen Rosen
2c534dc220 Improve annotation of jsonschema.validators.create (#8608) 2022-08-25 15:25:15 +02:00
Nipunn Koorapati
c17c0d5607 Bump protobuf to 3.20.1 (#8609)
There are even newer versions available (4.*), but I had found a bug
in it which prevented it from working with mypy-protobuf. For now,
sticking to just 3.20.1
2022-08-25 13:28:08 +01:00
Liam Damewood
3ab3711f42 tqdm: All leave arguments can be None (#8603)
All `leave` arguments are optional in tqdm.
2022-08-24 12:30:29 +02: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
Nikita Sobolev
57495ddaf4 Update redis/cluster.pyi (#8593) 2022-08-22 16:09:01 +02:00
Nikita Sobolev
383eca299b redis: Do not override AbstractRedis.RESPONSE_CALLBACKS (#8592) 2022-08-22 14:51:51 +01:00
kasium
cb15481633 Flask-SQLAlchemy: session should be scoped_session, not Session (#8589) 2022-08-22 13:30:33 +01:00
Oleh Prypin
d08e8baef7 Markdown: BlockProcessor.detab returns a pair of strings (#8586) 2022-08-21 19:59:41 +01:00
Nikita Sobolev
e17ca47782 Further improve redis.cluster (#8578) 2022-08-21 17:00:53 +01:00
Joel
8715951fca Improve return type for psycopg2 connect function (#8567)
When a `connection_factory` argument is provided to psycopg2's `connect` function, the function's return type now matches that of the factory output class. However, if `cursor_factory` is set and has a non-`None` value and/or `connection_factory` is not set or is `None`, the return type is simply `connection`, as before.
2022-08-20 16:34:13 -07:00
Nikita Sobolev
c6d34cc24d Improve redis.cluster types (#8573)
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-08-20 18:46:09 +01:00
forana
0d47b49840 Flask-SQLAlchemy: type session as Session (#8550) 2022-08-20 16:25:17 +01:00
Deon Pearson
d0d24b7301 redis: correct set command parameter types (#8536) 2022-08-20 16:21:39 +01:00
Kevin Kirsche
80ce12e295 Update setuptools to 65.1.* (#8565)
Fixes #8563
2022-08-18 18:16:24 -07:00
github-actions[bot]
f9450dcf8b [stubsabot] Bump regex to 2022.8.17 (#8562)
Co-authored-by: stubsabot <>
2022-08-18 17:48:23 -07:00
github-actions[bot]
d4fe6aac91 [stubsabot] Bump pytz to 2022.2.1 (#8564)
Co-authored-by: stubsabot <>
2022-08-18 17:48:06 -07:00
github-actions[bot]
0d8cf74819 [stubsabot] Bump Pygments to 2.13.* (#8561)
Co-authored-by: stubsabot <>
2022-08-18 17:47:59 -07:00
github-actions[bot]
3b767d1618 [stubsabot] Bump jsonschema to 4.12.* (#8560)
Co-authored-by: stubsabot <>
2022-08-18 17:33:41 -07:00
Kevin Kirsche
8c51fab4e2 Support extras in stubtest_third_party.py (#8467) 2022-08-18 14:12:36 -07:00
Alex Waygood
2c052651e9 Normalise use of Never vs NoReturn (#8549) 2022-08-17 21:53:40 +01:00
Akuli
0b28177268 Add stubs for tree-sitter-languages (#8548)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-08-17 23:35:44 +03:00
jakmarkowski
7bbe06c1b5 Add SAFE_RESTARTABLE strategy to ldap3 Connection client_strategy parameter (#8547) 2022-08-17 15:17:11 +02:00
Akuli
c9ebeb501c Add stubs for tree_sitter (#8533)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-08-16 21:48:59 -07:00
Joel
234ef7ed9d Additional return types for psycopg2 connections (#8528)
* Return types for psycopg2 dict connections

DB connection and cursor methods that deal with `dict`-style results now indicate the expected return types as implemented.

* Return types for psycopg2 namedtuple connections

DB connection and cursor methods that deal with `namedtuple` results now indicate the expected return types as implemented.

* Use ABC iterator

As required by flake8, the `Iterator` referenced in psycopg2's `extras` module has been switched to the `collections.abc.Iterator[T]` variant.

* Fix base psycopg2 cursor iter return type

The previous return type of `Self` is wrong; `cursor`'s `__iter__` method returns an `Iterator`.

* Correct return type for cursor iter and next methods

The previous attempt to fix the return type of `cursor`'s (and subclasses) `__iter__` method was misguided; they should indeed return `Self`. It's the `__next__` methods that had to be updated to return the correct record/row instance type.

* Comprehensive overloads for psycopg2 extra connections

Provides full method signatures for the `cursor` methods of the `DictConnection`, `RealDictConnection` and `NamedTupleConnection` types. Notably this includes a default value for `cursor_factory` in each case, while preserving the option to override the parameter manually.

* Have mypy ignore incompatible psycopg2 return types

The return types of the `fetch*` and `__next__` methods of `DictCursor`, `RealDictCursor` and `NamedTupleCursor` are incompatible with the base `cursor` class's corresponding methods' return types. However, this does accurately reflect reality, so ignore the mypy errors in those cases.

* Use ABC callable for psycopg2 extras module

As required by flake8, the `Callable` referenced in psycopg2's `extras` module has been switched to the `Callable` variant.

* Remove superfluous psycopg2 member overrides

Several members in the `DictCursorBase` type definition were entirely unnecessary, so they have been removed. In addition, adds a type to the `size` param of the `cursor`'s `fetchmany` method.
2022-08-16 21:48:05 -07:00
Shantanu
133d5f375c fpdf2: fix for 2.5.6 changes (#8546)
Life is much easier when upstream has some annotations

Fixes #8545
2022-08-16 21:32:39 -07:00
MaertHaekkinen
55c566ded5 cryptography: Rename parameter of serialize_key_and_certificates (#8543) 2022-08-16 15:20:45 +02:00
Alex Waygood
cf0b3a2596 Improve .keys(), .values(), .items() methods for TypedDicts (#8532) 2022-08-12 20:02:43 -07:00
Shantanu
2efaa6a379 setuptools: fix stubtest (#8540)
Fixes #8539
2022-08-12 19:37:11 -07:00
Andrey
92864413d2 Annotate Model in SQLAlchemy (#8535) 2022-08-12 11:47:31 +02:00
github-actions[bot]
8b0b500df3 [stubsabot] Bump setuptools to 64.0.* (#8534) 2022-08-11 19:53:47 -07:00
Alex Waygood
5a24bf8e1f setuptools: delete _distutils.command.check.HAS_DOCUTILS (#8529)
Fixes #8527
2022-08-11 07:17:00 +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
Andrey
5875bf48fe Flask-SQLAlchemy: Make model query non-generic (#8455)
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-08-10 18:13:02 +01:00
Alex Waygood
7eaedd44dd Add missing TypedDict methods and ClassVars (#8512) 2022-08-10 10:29:40 +01:00
Tareq Al-Ahdal
4f6aa12446 Enhanced type hinting for psycopg2 stubs (#8500) 2022-08-08 23:08:17 +02:00
PIG208
28fde2ee27 Add classmethod to stripe.PaymentIntent.confirm. (#8498)
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-08-08 15:58:29 +02:00
Shantanu
fed2e5e0ad psutil: improve svmem types (#8503) 2022-08-08 14:25:22 +02:00