197 Commits

Author SHA1 Message Date
Jia Chen
02b3a48313 Annotate load_entry_point() (#4775) 2020-12-14 17:20:40 +01:00
Sam Bull
8da53223d7 Fix pkg_resources.require() (#4818) 2020-12-14 09:34:18 +01:00
Sebastian Rittau
d2a7889fe0 Drop support for Python 3.5 (#4675)
Python 3.5 EOL was on 2020-09-30.
2020-11-02 16:18:20 +01:00
Mikołaj Kuranowski
40b44a9bf1 Add missing methods methods in aiofiles (#4734)
* fix aiofiles stubs

* switch io.BinaryIO to typing.BinaryIO

* swap typing.Literal to typing_extensions.Literal

* fix overload overlap in open function

* Fix filename generics

* add missing loop and executor arguments to aiofiles.open

* Remove generics from async files

* Fix async file-like read, readline and write signatures
2020-11-01 16:08:14 -08:00
Vincent Meurisse
0e002f41ef Add stub for pyrfc3339 (#4564) 2020-11-01 13:19:25 -08:00
Sebastian Rittau
4603728a15 Clean up files with former forced consistency (#4717)
Replace Text with str in Python 3 code
2020-10-27 07:52:35 +01:00
Jukka Lehtosalo
9134f7bc3c Fix type of typed_ast.ast27.Str.s (#4703)
The original type was too narrow.
2020-10-25 01:39:51 +02:00
Moriyoshi Koizumi
bad9701849 Fix aiofiles type definitions (#4650) 2020-10-23 10:49:51 +02:00
Shantanu
6ff5b88ca7 typeshed: remove crufty comments (#4699)
Co-authored-by: hauntsaninja <>
2020-10-23 09:40:06 +02:00
Utsav
6f943d43ea Added __class_getitem__ (#4695)
Resolves #4682

Co-authored-by: hauntsaninja <>
2020-10-22 14:05:04 -07:00
Kaushal Rohit
b9dadee6d6 Tighten pyjwt types using cryptography stubs (#4645) 2020-10-15 13:32:54 +02:00
Shantanu
7afc733054 pep 484: more reexports (#4607)
There are still a couple more, but hopefully this fixes CI. It's a
little bit of a chore to track down some of these; it looks like master
differs from latest release for a number of them.

Co-authored-by: hauntsaninja <>
2020-10-03 20:22:31 -07:00
Andrew Mitchell
8427e09424 ast.get_docstring: fix return type (#4595)
Resolves #4575
2020-10-01 18:48:09 -07:00
Shantanu
e3889c776e pep 484: explicit reexport as intended (#4586)
See discussion on typing-sig.
This doesn't take care of some third_party libraries, will follow up on
those.

Co-authored-by: hauntsaninja <>
2020-09-30 10:04:23 -07:00
Lam Son Ho
04f7d7a2fd add stubs for frozendict (#4522) 2020-09-11 10:36:57 +02:00
Sebastian Rittau
3c20675813 Remove pytest_mock (#4478)
pytest-mock is now type annotated, which makes typeshed's annotations
obsolete. See pytest-dev/pytest-mock#152.
2020-08-29 14:47:34 -07:00
Jukka Lehtosalo
5be9c91518 freezegun: Fix __exit__ and remove union return types (#4491)
These caused false positives, for example in code like this:

```
    with freeze_time(None) as ft:  # False positive here
        ft.tick(3)  # False positive here
```
2020-08-28 16:50:05 +01:00
Jukka Lehtosalo
3e966524b7 Add back six.moves.cStringIO (Python 3) (#4490)
This was accidentally removed in #4287.
2020-08-28 16:49:56 +01:00
Jelle Zijlstra
5f9fd3d127 upgrade black version (#4486)
Manually removed a number of trailing commas to prevent black from unnecessarily
exploding some collections.
2020-08-26 18:36:01 +02:00
Jukka Lehtosalo
ab0f5519a9 Add back six.moves.range (Python 3) (#4481)
This was accidentally removed in #4287.
2020-08-25 16:42:15 +01:00
Eric Traut
8cbf009bb7 Added some missing type annotations within third-party stub files (#4467)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-21 00:51:15 +02:00
Eric Traut
52e18e856c Added stubs for aiofiles package (#4421) 2020-08-19 08:33:33 -07:00
Eric Traut
cac35d0631 Contributed stubs for freezegun package (#4425)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-10 13:33:09 -07:00
Eric Traut
4b9de7752e Contributed stubs for filelock package (#4424)
Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-10 13:32:51 -07:00
Anders Kaseorg
bb685daad1 Update orjson.pyi from upstream (#4405)
https://github.com/ijl/orjson/blob/master/orjson.pyi

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-08-06 19:40:26 -07:00
Eric Traut
de4ea8681d Removed imported symbols that are not accessed or re-exported (third_party part 4 of 4) (#4391)
* Removed imported symbols that are not accessed or re-exported from within third_party stubs (part 4). These were all identified as unused symbols by the pyright type checker and language server.

Co-authored-by: Eric Traut <erictr@microsoft.com>
2020-08-06 22:11:22 +02:00
Sebastian Rittau
cfd06e2d3c Enable aliases in pytest_mock (#4359)
* Require newer pytype
2020-07-25 12:13:00 -07:00
Sabby6
42d20c4a07 pkg_resources: Add missing methods of pkg_resources.DistributionNotFound (#4344) 2020-07-20 19:31:50 +02:00
Jelle Zijlstra
0142a87da8 adjust isort config (#4290)
Fixes #4288.

- Default imports to THIRD_PARTY, so in effect we merge the FIRST_PARTY and THIRD_PARTY stubs. This means import order is no longer affected by whether typing_extensions is installed locally.
- Treat typing_extensions, _typeshed and some others as standard library modules.

Note that isort master is very different from the latest release; we'll have to do something
different if and when the next isort release comes out.
2020-06-29 00:00:21 -07:00
Jelle Zijlstra
5d553c9584 apply black and isort (#4287)
* apply black and isort

* move some type ignores
2020-06-28 13:31:00 -07:00
Sebastian Rittau
0704214701 Add pytest_mock stubs (#4275) 2020-06-27 19:46:47 -07:00
Sebastian Rittau
89d3a55f1a Preparations for the Big Reformat (#4228)
A few comments between imports were removed or moved to the top of the
import block, due to behavioral differences between black and isort. See
psf/black#251 for details.

In two instances @overloads at the top of the file needed to be moved
due to psf/black#1490.
2020-06-14 07:58:26 -07:00
Sebastian Rittau
a913af9523 flake8: Enable F811 (#4158) 2020-06-02 14:08:54 -07:00
Gal Ben David
d11da2c5d1 revert orjson.pyi obj parameter (#4046)
After submitting a pull request to orjson repository, the author has changed the library and "obj" parameter is now positional only.
Not this behavior is aligned with the stub file and the change can be reverted.

https://github.com/ijl/orjson/releases/tag/3.0.1
2020-05-20 09:11:39 -07:00
dosisod
2ead8123a6 Add Waitress stubs (#3889) 2020-05-13 16:22:13 +02:00
Gal Ben David
1d2ec3cd3b Update orjson.pyi to support two new flags (#3975)
Updated orjson.pyi to support two new added flags `OPT_INDENT_2` and `OPT_NON_STR_KEYS`.
Renamed `__obj` to `obj` to allow using named parameter `obj` instead of positional, without getting errors.
2020-05-12 18:06:06 -07:00
Peter Pentchev
0503fb0f50 Fix some pkg_resources variable types. (#3919)
Allow passing proper metadata to Distribution.from_location() and
Distribution.from_filename().

Correct the order of arguments for the importer functions.

Note that some functions accept any iterables, not just sized ones.

Correct the type of the VersionConflict classes' context.
2020-04-09 12:22:14 +02:00
Shantanu
e56adddc48 dataclasses: change hash to unsafe_hash, add a minor overload (#3892)
Co-authored-by: hauntsaninja <>
2020-04-03 17:23:05 -07:00
Ivan Levkivskyi
aa945cde03 Add six.moves.collections_abc. (#3812) 2020-03-06 00:13:24 +00:00
ijl
ea0a9c2bd6 Update orjson annotations to 2.4.0 (#3737) 2020-02-14 08:32:24 -08:00
Rune Tynan
e3ddfd46b4 Fix missing type for dataclasses (#3708)
* Add missing return type to make_dataclass

* Fix consistency check
2020-02-02 21:58:15 -08:00
Anthony Sottile
d0f57d7d38 Fill out more attributes in six (#3589) 2020-01-18 07:41:51 -08:00
Dylan Anthony
9b63192390 Update orjson stub from orjson repository(#3532) 2019-12-06 15:59:27 +01:00
Utkarsh Gupta
72ff7b94e5 __init__.pyi: Accept RSAPrivateKey or RSAPublicKey as the key (#3410)
Closes: #3381
2019-10-26 21:09:06 +02:00
Vasily Zakharov
57384ce033 Revised stubs for geoip2 third party library (#3317) 2019-10-09 19:28:42 -07:00
Utkarsh Gupta
4027add6b3 __init__.pyi: Add missing methods on pkg_resources.VersionConflict (#3318) 2019-10-08 20:36:38 +02:00
Sebastian Rittau
256b3ce8ab Remove a bunch of unused imports (#3323) 2019-10-08 07:59:32 -07:00
Vasily Zakharov
e62857f851 Updated maxminddb stubs to v1.5.0 (#3300) 2019-10-04 12:55:46 +02:00
Sebastian Rittau
ed4b1de0ad Fix third_party errors with --disallow-any-generics (#3278)
Part of #3267. Together with #3276 this should fix all such problems.
2019-09-30 13:14:01 +02:00
Vasily Zakharov
4d662f0f49 Stubs for maxminddb added (#3245) 2019-09-19 17:49:38 +02:00