Commit Graph

171 Commits

Author SHA1 Message Date
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
Benjamin Peterson
a48abb4546 Add unquote_to_bytes to Python 3 six.moves.urllib.parse. (#3208) 2019-08-28 18:01:38 -07:00
Sebastian Rittau
9ccf9356bf Remove Python 3.4 support (#3147)
Closes #3123
2019-07-27 10:58:21 +02:00
Benjamin Woodruff
3272307933 Make dataclasses.Field.metadata non-optional (#3094)
If `metadata` is `None` the Field constructor replaces it with an empty
mapping object, so this value can never be None.

https://github.com/python/cpython/blob/v3.7.3/Lib/dataclasses.py#L243
2019-06-28 18:28:50 -07:00
Jean Hominal
897148073a Add functions to six.moves.urllib.request (#2982)
parse_http_list and parse_keqv_list were added to six.moves.urllib.request
in version 1.11.
2019-05-13 10:29:34 +02:00
ijl
5acc22d82a Specify default = ..., positional-only for orjson API (#2936) 2019-04-27 11:09:26 -07:00
Michael Lee
efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
ijl
9bbe60978e Add type hints for orjson (#2747) 2019-02-11 01:56:57 +01:00
秋葉
e0e83a2dcc Use a more accurate type for jwt.decode (#2765)
Closes #2764
2019-02-09 15:59:58 +01:00
Joachim Jablon
caefaa6af9 pkg_resources: fix stub for get_metadata_lines (#2776) 2019-02-01 07:58:49 -08:00
Joachim Jablon
90d3a6e2e2 pkg_resources Add PKG_INFO str attribute for Distribution class (#2775)
To avoid
```
error: "Distribution" has no attribute "PKG_INFO"
```
This is the corresponding implementation:
8f82e5077e/pkg_resources/__init__.py (L2531)
2019-02-01 07:58:13 -08:00
Frazer McLean
9e5816a539 Fix six.raise_from value type (#2746)
Fixes #2742
2019-01-17 20:16:38 +01:00
Guido van Rossum
a2c0f4b827 Add stubs for six.ensure_{binary,str,text} functions (#2704) 2018-12-19 16:07:16 -08:00
Michael Lee
44e6b6e0d4 Add Str.kind field to typed_ast stubs (#2699)
We recently cut a new-ish release of typed-ast that [adds a new field][0]
named `kind` to the `ast27.Str` and `ast3.Str` classes. This field
stores whatever string modifiers (like `b` or `u`) were present on the
original string.

As a note, I've confirmed that this field is indeed a str (and not
bytes) for ast27's Str class.

  [0]: https://github.com/python/typed_ast/pull/49
2018-12-18 10:37:19 -08:00
Dan Čermák
f7c9677703 Add members marker and unsafe_name to pkg_resources.Requirement (#2693)
For now specify Requirement.marker as Optional[Any] (as suggested by @srittau)
as we can't import packaging.markers (pkg_resource does that via runtime magic
in pkg_resources.external)

Closes #2961
2018-12-18 16:26:56 +01:00
Sebastian Rittau
82c59a7fc2 Merge Python 2 and 3 versions of itsdangerous (#2564) 2018-11-20 17:55:16 +01:00
Sebastian Rittau
cd75801aa5 Replace non-ellipsis default arguments (#2550) 2018-11-20 07:35:06 -08:00
Sebastian Rittau
e3a79d0ce6 Remove third_party/3/enum.py (#2563)
All Python 3 versions supported by typeshed (3.4+) have enum as part
of the standard library.

Make the third-party Python 2 version consistent with the Python 3 version.
2018-10-27 08:54:56 -07:00
Sebastian Rittau
006a79220f Flake8 fixes (#2549)
* Fix over-indented continuation lines

* Fix under-indented continuation lines

* Fix whitespace around default operator problems

* Limit line lengths

* Fix inconsistent files
2018-10-24 07:20:53 -07:00
Sebastian Rittau
c4f4c40601 Annotate jwt.algorithms (#2532)
Cf. #1446
2018-10-23 09:32:14 -07:00
Michael Lee
53d12c0a6c Makes enums accept objects in the argument type (#2539)
Fixes problems with using enums with the --disallow-any-expr flag.
2018-10-23 09:52:15 +02:00
Michael
82d54ce57b Update PyJWT's exceptions (#2522)
Regards jpadilla/pyjwt#316, jpadilla/pyjwt#335, jpadilla/pyjwt#340
2018-10-21 13:30:37 +02:00
Rebecca Chen
77e4d5d5a8 Add six.moves.urllib_request and six.moves.urllib_response. (#2455) 2018-09-13 22:01:56 +02:00
Teddy Sudol
b40cae139f Add more complete type hints for pkg_resources. (#2433)
The current file only covers pkg_resources/__init__.py.
pkg_resources/py31compat.pyi is used by setuptools, for example.
2018-09-13 22:00:04 +02:00
Jon Dufresne
47f22a341e Add def __getattr__(name) -> Any: ... to all docutils stubs (#2439)
The stubs are very incomplete causing false positive when used. Add a
fallback to until they can become more complete.
2018-09-13 21:59:13 +02:00
Sebastian Kreft
c96812425a Overload the definitions of dataclasses.asdict and dataclasses.astuple (#2422) 2018-09-06 22:14:28 -07:00
Michael J. Sullivan
55b9aaf916 Add Optional to typed_ast's arguments.type_comments (#2430)
This covers the case where some but not all arguments have a `# type:` comment.
2018-09-06 18:56:10 -07:00