Commit Graph

474 Commits

Author SHA1 Message Date
Jukka Lehtosalo
e3773ad691 Fix typos in yaml stubs (save_* -> safe_*) (#2985) 2019-05-13 11:57:34 -04:00
Simon Kohlmeyer
a868221347 Update dateutil to 2.7.5 (#2694)
This is still missing the easter and tzinfo module, but includes newer
functions like today and isoparse.
2019-05-13 07:58:43 -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
Rebecca Chen
aa4a84ef3f Always use fully qualified names to refer to nested classes. (#2983)
The main purpose of this change is to get the stubs into a
form that pytype will support with its next release. Since
these stubs already mostly use fully qualified names, this
will also increase consistency.
2019-05-12 15:10:48 -07:00
Danny Weinberg
b4376fc3d2 Have click.style return a str (#2981)
This previously was missing a return type and therefore defaulting to
`Any`, but it actually returns a `str`.
2019-05-11 22:20:31 +02:00
zadamah
c03100230d Add new show_choices argument to click options (#2978) 2019-05-09 16:28:08 +02:00
Ivan Levkivskyi
d61635e243 Add TypedDict to typing_extensions (#2940)
Since there is a PEP for `TypedDict` (PEP 589), it is being added to `typing_extension`, see https://github.com/python/typing/pull/628. This PR essentially copies the definition from `mypy_extensions`.

Corresponding mypy PR https://github.com/python/mypy/pull/6744 can be merged independently of this PR.
2019-05-07 14:45:45 -04:00
Rebecca Chen
4990830c8f Make pytype happy with the third_party click stubs. (#2966)
This also makes the flask stubs that depend on click parseable.

* In pytype_test, only parse files with the .pyi extension.
  (There's a README in third_party/2and3/click/.)
* Annotate with ContextManager rather than using the
  contextmanager decorator. This is shorter, removes a
  dependency, and gets rid of the slight weirdness of a
  decorator needing to be evaluated in a stub.
* Fix non-stub things.
2019-05-07 08:50:24 +02:00
Max Rydahl Andersen
5dda362b05 add autocomplete to click decorators (#2705) 2019-05-06 22:05:48 -04:00
Rebecca Chen
a6d92eca10 Adjust indentation of TODOs in third_party/2/gflags.pyi. (#2964)
Having TODOs at a different level of indentation than
the surrounding lines trips up pytype.
2019-05-06 22:05:17 -04:00
Rebecca Chen
7c475a48d7 Fix typo: __builtins__ should be __builtin__. (#2963) 2019-05-06 22:00:02 -04:00
Chad Birch
e0b3cdd6fc Bleach stubs: fix typos, use protocol classes (#2957) 2019-05-06 19:50:29 +02:00
Dan Crosta
e67961e387 add click.types.DateTime to click stubs (#2958) 2019-05-06 11:36:49 -04:00
Philipp Hahn
548dbbbc71 yaml.dump(..., stream) is optional (#2289)
Depending on if a "stream" or the "encoding" is given, the functions
either return None, str/unicode or bytes.
Use @overload fix distinguish those cases.

Also fix the functions using **kwds as they delegate their work to the
more generic functions: copy their signatures.

* yaml.dump(): Drop distinguishing encoding

As far as I know it's currently impossible to use "overloads with return
types depending on optional arguments" (Issue #5621). As "encoding" is
in the middle of 11 optional arguments, it would require ~ 2^6 overloads
for each of those 6 functions.

For now just return Any and wait for Issue #5621 to get fixed.
2019-05-06 10:10:11 -04:00
Ethan Madden
12fa5c4fdb Added defs for undocumented attrs on enums (#2941)
This should resolve #2934
2019-05-05 15:07:22 -04:00
Utkarsh Gupta
4d61442004 click/types.pyi: Add case_sensitive wrt click 7.0 (#2948)
Fixes #2942
2019-05-03 10:44:36 -04:00
Scott Belden
556f354e1e add BadRequestKeyError (#2944) 2019-05-02 11:45:04 +02:00
Jia Chen
cda204a151 Remove MutableMapping from requests.Session.cookies's type (#2946) 2019-05-02 10:39:42 +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
Anthony Sottile
cfa65b831b flask.Flask.run: port can be str (#2903)
86bf9dca72/flask/app.py (L933)
2019-04-08 11:41:37 -07:00
Josh Morton
d46d36b7d7 Add six.moves types for email_mime sources. (#2902)
As a followup to the work done in #2767 and #2830, and to address a
piece of #66, most of the email_mime submodules aren't typed in six
under python2, only python3. Now they are.
2019-04-08 19:56:29 +02:00
Shahar Evron
0f5302b3b5 Accept bytes as 1st argument of simplejson.loads (#2896) 2019-04-02 16:40:59 +02:00
Brendan Long
d371513b80 werkzeug: ETagRequestMixin's functions are properties (#2894)
This was causing mypy to incorrectly flag reads of these properties
and complain that they're Callable, which is incorrect.
2019-03-30 18:44:10 +01:00
Christopher Dignam
f7c00b8b33 yaml: add full_load and full_load_all stubs (#2892) 2019-03-29 08:26:13 +01:00
Hynek Schlawack
7646506c14 Add missing dateutil.tz.UTC (#2883)
Co-Authored-By: hynek <hs@ox.cx>
2019-03-22 21:42:55 +01:00
yoshiyuho
0f1e453606 Fix werkzeug.UserAgentMixin annotation (#2881) 2019-03-22 08:24:44 +01:00
Jeff
168a968564 [third_party/click] add Exit exception definition (#2880) 2019-03-21 23:08:59 +01:00
JinyuanShanghai
15e1f76f61 move pycurl.pyi from 2 to 2and3 (#2867) 2019-03-14 23:14:52 +01:00
Tom Briggs
cd088c44d2 Click: add 'length' and 'label' properties to ProgressBar. (#2860) 2019-03-12 20:58:40 +01:00
Gabriel Corona
d595a46912 Fix several Flask types (#2858)
* Flask.static_folder is Optional
* Fix some types in Flask
2019-03-12 20:57:37 +01:00
Sebastian Rittau
6f00053511 Add stubs for bleach (#2709)
* Add stubs for bleach

* Support Python 2 for bleach

* Add missing imports
2019-03-10 21:08:46 -07:00
Gleb Chipiga
bf370b5908 Update attr stubs to 19.1.0 (#2846) 2019-03-11 00:11:26 +01:00
Eric Traut
06c682449f Fix inconsistent self/cls parameter names (#2838)
Fixed several inconsistent parameter names so all instance methods take 'self' and all class methods take 'cls'. This avoids warnings or errors from linting tools that enforce standard naming conventions.
2019-03-10 03:17:55 +01:00
Eric Traut
748ad3d21f Removed extraneous import statement that was redefining three symbols in markupsafe/__init__.py. This redefinition triggered type checking/linting errors. (#2842) 2019-03-10 02:57:54 +01:00
秋葉
b588d43a32 Add sunder names to enum (#2822)
Closes #2766
2019-03-06 15:31:53 +01:00
Jelle Zijlstra
b5897d5643 fix undefined name in flask stub (#2811) 2019-02-23 10:28:03 +01:00
Nipunn Koorapati
07ea6614c8 Genericize types for stringly typed methods on google.protobuf.Message (#2807) 2019-02-22 22:23:32 -08:00
秋葉
570fd6aff1 Add some missing annotations in cyaml (#2769)
* update annotation of cyaml

* fix wrong type
2019-02-17 13:28:05 -08:00
Bertrand Bonnefoy-Claudet
2bd16c42f6 Fix Flask stubs for dispatch_request (#2796)
`dispatch_request` can accept arbitrary arguments and can return
different values.  To keep this simple and in line with the rest of the
stubs (e.g. with `view_func: Callable[..., Any]`), `Any` is used for the
return value although it is too broad.

Closes #2795.
2019-02-15 00:08:25 +01:00
Antoine Fourmy
b3aac58db0 root_path cannot be None (#2792)
Fixes #2791
2019-02-12 14:00:56 +01:00
Ivan Levkivskyi
ca62cecd14 Fix Flask.config annotation (#2787) 2019-02-11 14:19:42 +01:00
ijl
9bbe60978e Add type hints for orjson (#2747) 2019-02-11 01:56:57 +01:00
lincolnq
b00bb54dc5 Some small tweaks to Werkzeug stubs: (#2784)
* default_exceptions is a dict of classes, not instances
* Correctly overload 'redirect' to get the proper return type
* Request.get_data() is an Any (not bytes), just like Response.get_data
2019-02-09 20:30:28 +01:00
Utkarsh Gupta
e1a02a6f0a decorators.pyi: Add overload to option() (#2671)
Fixes #1692
2019-02-09 19:05:07 +01:00
秋葉
e0e83a2dcc Use a more accurate type for jwt.decode (#2765)
Closes #2764
2019-02-09 15:59:58 +01:00
Ingmar Steen
c5713205ff requests.auth.AuthBase.__call__ deals with PreparedRequest. (#2759)
Both the argument and the return type are expected to be instances
of requests.models.PreparedRequest, not requests.models.Request.
2019-02-09 15:19:54 +01:00
Benjamin Peterson
6850b9d699 gflags: Add DEFINE_multi_enum. (#2783)
4f06c3d0d6/gflags/__init__.py (L800)
2019-02-08 15:14:52 -08:00
Paul Dagnelie
ed4323df30 Update models.pyi (#2780)
Currently, iter_lines() doesn't have any type annotations despite the types being very similar to iter_content and the types can be pretty readily derived from the source.
2019-02-07 07:21:57 -08:00
Andrew Svetlov
c45c0635c1 Add hidden and deprecated click.Command options (#2778) 2019-02-03 11:05:53 +01:00