Commit Graph
147 Commits
Author SHA1 Message Date
Benjamin PetersonandJelle Zijlstra a48abb4546 Add unquote_to_bytes to Python 3 six.moves.urllib.parse. (#3208) 2019-08-28 18:01:38 -07:00
Sebastian RittauandGitHub 9ccf9356bf Remove Python 3.4 support (#3147)
Closes #3123
2019-07-27 10:58:21 +02:00
Benjamin WoodruffandJelle Zijlstra 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 HominalandSebastian Rittau 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
ijlandJelle Zijlstra 5acc22d82a Specify default = ..., positional-only for orjson API (#2936) 2019-04-27 11:09:26 -07:00
Michael LeeandSebastian Rittau efb67946f8 Use variable annotations everywhere (#2909) 2019-04-13 10:40:52 +02:00
ijlandSebastian Rittau 9bbe60978e Add type hints for orjson (#2747) 2019-02-11 01:56:57 +01:00
秋葉andSebastian Rittau e0e83a2dcc Use a more accurate type for jwt.decode (#2765)
Closes #2764
2019-02-09 15:59:58 +01:00
Joachim JablonandJelle Zijlstra caefaa6af9 pkg_resources: fix stub for get_metadata_lines (#2776) 2019-02-01 07:58:49 -08:00
Joachim JablonandJelle Zijlstra 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:
https://github.com/pypa/setuptools/blob/8f82e5077e2d3aab14aa3da636f79d37ff6d7ed7/pkg_resources/__init__.py#L2531
2019-02-01 07:58:13 -08:00
Frazer McLeanandSebastian Rittau 9e5816a539 Fix six.raise_from value type (#2746)
Fixes #2742
2019-01-17 20:16:38 +01:00
Guido van RossumandJelle Zijlstra a2c0f4b827 Add stubs for six.ensure_{binary,str,text} functions (#2704) 2018-12-19 16:07:16 -08:00
Michael LeeandGitHub 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ákandSebastian Rittau 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 RittauandGitHub 82c59a7fc2 Merge Python 2 and 3 versions of itsdangerous (#2564) 2018-11-20 17:55:16 +01:00
Sebastian RittauandJelle Zijlstra cd75801aa5 Replace non-ellipsis default arguments (#2550) 2018-11-20 07:35:06 -08:00
Sebastian RittauandJelle Zijlstra 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 RittauandJelle Zijlstra 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 RittauandJelle Zijlstra c4f4c40601 Annotate jwt.algorithms (#2532)
Cf. #1446
2018-10-23 09:32:14 -07:00
Michael LeeandSebastian Rittau 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
MichaelandSebastian Rittau 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 ChenandSebastian Rittau 77e4d5d5a8 Add six.moves.urllib_request and six.moves.urllib_response. (#2455) 2018-09-13 22:01:56 +02:00
Teddy SudolandSebastian Rittau 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 DufresneandSebastian Rittau 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 KreftandJelle Zijlstra c96812425a Overload the definitions of dataclasses.asdict and dataclasses.astuple (#2422) 2018-09-06 22:14:28 -07:00
Michael J. SullivanandGitHub 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
Teddy SudolandJelle Zijlstra 2cd0aa16b5 Fix pkg_resources.pyi formatting (#2396) 2018-08-21 21:51:04 -07:00
Michael J. SullivanandJukka Lehtosalo d45fc3daaf Fix typed_ast's Num type (#2387) 2018-08-16 11:36:13 +01:00
MinJune KimandJelle Zijlstra dc6d1ff8d3 Re-add .resolve() method to package_resources.Entrypoint (#2385)
Fixes #1463
2018-08-15 10:40:45 -07:00
Gary van der MerweandJelle Zijlstra c1f89a90b4 Make dataclasses available as a backported third_party library. (#2354) 2018-08-07 10:04:33 -07:00
Sebastian RittauandJelle Zijlstra dc9f9db77f Assorted thirdparty fixes (#2332)
* pkg_resources.Distribution: Fix self arguments

* docutils: Remove spurious ellipses

* Add self argument to markupsafe.Markup.format()

While the actual signature is also "def format(*args, **kwargs)", the
implementation extracts "self" from "args" as first step.

* werkzeug: Remove methods not present during runtime

UpdateDictMixin.calls_update() and EnvironBuilder.form_property()
get deleted while constructing the respective class.

* requests: Add missing self argument
2018-07-13 19:23:23 -07:00
Yusuke MiyazakiandJelle Zijlstra 5bb58af6c8 Use float instead of Union[int, float] (#2308) 2018-07-09 19:02:03 -07:00
Yusuke MiyazakiandJelle Zijlstra 581705d9ee Prefer to use ellipsis over pass (#2292) 2018-06-28 10:29:45 -07:00
Yusuke MiyazakiandJelle Zijlstra 86883d3df9 Remove unused import statements (#2282) 2018-06-27 20:14:57 -07:00
Sebastian RittauandJelle Zijlstra b05e99297c Drop Python 3.3 support from several stubs (#2266)
* Drop Python 3.3 support from importlib stubs

* Drop Python 3.3 support from html and symbol stubs
2018-06-20 16:46:11 -07:00
Jelle ZijlstraandGitHub 94ab32ba59 Fix abstract classes for Python 3 (#2239)
* add metaclass=ABCMeta to some classes

* mark some more classes as explicitly abstract

* make some more classes concrete
2018-06-16 10:18:54 -07:00
Guido van RossumandGitHub c5e98308c0 Copy stdlib/3.4/enum.pyi to third_party/3/enum.pyi to satisfy tests (#2214)
Fix test breakage caused by #2118.
2018-06-11 14:28:47 -07:00
Sebastian RittauandJelle Zijlstra fcc1b7def4 Merge Python 2 and 3 versions of werkzeug (#2185)
The Python 2 version was slightly outdated compared to the Python 3
version.

The Python 2 version of Headers.__delitem__() had an optional argument
_index_operation that also exists in the implementation. But considering
this is internal use only, it was missing from the Python 3 version, and
it created problems with derived classes, I decided not to add it to
the merged stub. See also pallets/werkzeug#1051.
2018-06-05 08:16:23 -07:00
Sebastian RittauandJelle Zijlstra c3897b4a14 A few werkzeug type fixes (#2181)
* BaseRequest.stream
* ResponseStreamMixin.stream
* get_content_length()
* get_input_stream()
2018-05-31 21:38:51 -07:00
Michael LeeandJelle Zijlstra 709b193416 Rearrange overloads to account for optional arguments (#2150)
Basically, the same thing as [my previous pull request][0], except the
fixes are now focusing on functions with overlapping argument counts.

  [0]: https://github.com/python/typeshed/pull/2138
2018-05-19 09:20:16 -07:00
Ethan SmithandJelle Zijlstra e9600db2ec Remove symlinks! (#2132) 2018-05-15 15:18:59 -04:00
Daniel LiandJelle Zijlstra 56a31be7a7 Add stubs for submodules of six.moves (#2108)
To support "from six.moves.cPickle import loads", we must add a stub for
six.moves.cPickle as if it were a real submodule, even though it isn't
implemented as such. This fixes python/mypy#1550.

We don't apply this approach to six.moves.builtins on Python 2, because
it seems to confuse mypy.

We also add stubs for aliases in six.moves whose underlying modules have
been added to typeshed.

For Python 2:
    - six.moves.SimpleHTTPServer (alias for SimpleHTTPServer)

For Python 3:
    - six.moves.tkinter_dialog (alias for tkinter.dialog)
    - six.moves.tkinter_filedialog (alias for tkinter.filedialog)
    - six.moves.tkinter_commondialog (alias for tkinter.commondialog)
    - six.moves.tkinter_tkfiledialog (alias for tkinter.filedialog)
2018-05-12 12:02:44 -04:00
Charles-Axel DeinandJelle Zijlstra 5818893a7f Add default_exceptions to werkzeug.exceptions (#2071) 2018-04-19 09:03:24 -07:00
Jelle ZijlstraandGuido van Rossum 6862434eae fix return type for itsdangerous.Signer.unsign (#2029)
Fixes #2011

Also fixed the argument type (it doesn't accept str).
2018-04-09 12:00:41 -07:00
Jelle ZijlstraandGuido van Rossum d24799fd31 uncomment a few parts of six.moves (#2019) 2018-04-06 11:20:14 -07:00
Jelle ZijlstraandŁukasz Langa 0c15e5bdcc Improve werkzeug stubs (#1730) 2018-03-28 19:38:35 -07:00
Sebastian RittauandJelle Zijlstra 6cf97b8db2 Proper types for Common{Request,Response}DescriptorsMixin (#1948)
* werkzeug: Add proper types for CommonRequestDescriptorsMixin

* werkzeug: Add proper types for CommonResponseDescriptorsMixin
2018-03-16 20:13:03 -07:00
rchen152andMatthias Kramm 38dc8f5a6a Switch usages of mypy_extensions.NoReturn over to typing.NoReturn. (#1942)
* Change mypy_extensions.NoReturn to typing.NoReturn everywhere.
2018-03-05 12:42:29 -08:00
Sebastian RittauandJelle Zijlstra a08d57833f Fix werkzeug environ type (#1831)
* Fix werkzeug environ type

PEP 3333 explicitly calls for environ to be a built-in dict. Using a
Mapping will not only prevent the dict from being modified (which is
explicitly allowed by PEP 3333), it will also cause interaction
problems when the environment is passed to other WSGI handlers.

Also change the value type from object to Any for convenience. By
definition, the values can be anything and can't be type checked.
Using object instead of Any forces us to explicitly cast the value
whenever we access it.

* Use Union[str, unicode] for Werkzeug environment keys

This matches the type in wsgiref.types.

* Use WSGIEnvironment from wsgiref.types

* Add '= ...' to environ attribute
2018-01-26 14:30:23 -08:00
Jelle ZijlstraandMatthias Kramm fb2c7b34e2 Improve itsdangerous stubs (#1733) 2018-01-02 12:50:22 -08:00