Commit Graph

6927 Commits

Author SHA1 Message Date
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
5b47f13a99 Add _threading_local.local.__delattr__ back to the stub (#8526) 2022-08-15 11:56:31 +02:00
Peter Law
3623f923a6 Fix UDPServer to correctly inherit from TCPServer (#8542) 2022-08-13 19:03:59 +02:00
Jelle Zijlstra
5477097c6d Upgrade pyright (#8541) 2022-08-12 20:24:51 -07:00
Nikita Sobolev
d53d3258b2 Add "Naming convention" to test_cases/README.md (#8521)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-08-12 20:15:23 -07: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
Alex Waygood
1ec57121e3 Unpin stubtest from 3.10.5 (#8523) 2022-08-12 10:01:26 +02:00
github-actions[bot]
8b0b500df3 [stubsabot] Bump setuptools to 64.0.* (#8534) 2022-08-11 19:53:47 -07: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
Nikita Sobolev
510feeb3fc Improve constructor for builtins.dict (#8517)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-08-10 19:04:07 +01:00
Nikita Sobolev
5cc966cc57 Improve email.headerregistry.HeaderRegistry stub (#8516) 2022-08-10 19:00:11 +01: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
Nikita Sobolev
266fed2f83 Consistent naming of files in the test_cases directory (#8520) 2022-08-10 10:33:42 +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
pre-commit-ci[bot]
ed06b8bf54 Upgrade flake8 to 5.0.4 (#8507)
updates:
- [github.com/pycqa/flake8: 5.0.2 → 5.0.4](https://github.com/pycqa/flake8/compare/5.0.2...5.0.4)

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-09 09:56:19 +01:00
Nikita Sobolev
4e3e9ba2c6 Remove outdated TODO comment (#8508) 2022-08-09 09:55:45 +02:00
Tareq Al-Ahdal
4f6aa12446 Enhanced type hinting for psycopg2 stubs (#8500) 2022-08-08 23:08:17 +02:00
Nikita Sobolev
4e5d9d1cca Add missing metaclasses in ast and contextlib (#8497) 2022-08-08 16:08:07 +01: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
Tareq Al-Ahdal
d7a5a147a0 psutil: types for virtual_memory (#8501) 2022-08-07 14:19:19 -07:00
Nikita Sobolev
64bc0590a6 Remove un-needed __hash__ methods from stdlib (#8465) 2022-08-06 14:55:27 +01:00
Nikita Sobolev
ac86defef7 Simplify multiprocessing.context.{SpawnProcess,SpawnContext} (#8499) 2022-08-06 12:03:43 +01:00
Alex Waygood
892796a794 Remove, move or # noqa more TypeAlias declarations (#8450) 2022-08-05 13:03:19 +01:00
Kevin Kirsche
3e88363b34 requests.adapters: use re-exports rather than assignments (#8485) 2022-08-05 12:46:07 +01:00
Kevin Kirsche
68f20a4a23 Add requests.help submodule (#8486) 2022-08-05 12:32:40 +01:00
Kevin Kirsche
46a3806312 Add requests.__version__; improve requests.__init__ (#8484)
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-05 12:28:35 +01:00
github-actions[bot]
eb07618098 [stubsabot] Bump dj-database-url to 1.0.* (#8488)
* [stubsabot] Bump dj-database-url to 1.0.*

* Add DJANGO_VERSION

Co-authored-by: stubsabot <>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-08-05 12:12:37 +01:00
github-actions[bot]
67ff035dbb [stubsabot] Bump jsonschema to 4.9.* (#8491)
* [stubsabot] Bump jsonschema to 4.9.*

* Remove jsonschema._reflect

Co-authored-by: stubsabot <>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-08-05 11:26:24 +01:00
Nikita Sobolev
2f15b0d4db _sendfile_compatible is a class variable (#8496) 2022-08-05 10:52:08 +02:00
Shantanu
02a72d0045 Bump pyflakes to 2.5.* (#8495) 2022-08-05 08:55:36 +02:00
github-actions[bot]
959840a12d [stubsabot] Bump flake8-typing-imports to 1.13.* (#8489)
Co-authored-by: stubsabot <>
2022-08-04 17:53:58 -07:00
github-actions[bot]
c867a8ea70 [stubsabot] Bump flake8-2020 to 1.7.* (#8492)
Co-authored-by: stubsabot <>
2022-08-04 17:53:47 -07:00
github-actions[bot]
fe99d2322c [stubsabot] Bump setuptools to 63.4.* (#8493)
Co-authored-by: stubsabot <>
2022-08-04 17:53:42 -07:00
Nikita Sobolev
a03e8b4949 Revert __eq__ removal (#8487)
Refs #8483
2022-08-04 23:51:42 +02:00
Nikita Sobolev
a376da87bd Remove duplicate definitions (#8483) 2022-08-04 18:55:18 +02:00
Kevin Kirsche
103c2f39d2 Add urllib3.contrib.socks; improve urllib3.connectionpool (#8457)
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-04 11:36:40 +01:00