Ivan Levkivskyi
75e13a0f36
Add Final to typing_extensions ( #2453 )
2018-09-13 15:07:42 +01:00
Sebastian Rittau
27514df2bd
Fix annotation of boto Key.set_contents_from_string ( #2445 )
...
Closes #1552
2018-09-11 08:25:25 -07:00
Jelle Zijlstra
9d62d6d5c5
fix __metaclass_ references ( #2402 )
2018-09-06 18:24:03 -07:00
Ivan Levkivskyi
8ed0159445
Remove duplicate method definitions in importlib and jinja2 ( #2427 )
2018-09-04 07:50:47 -07:00
Teddy Sudol
c52c59f521
Remove duplicate adapters import. ( #2414 )
...
This causes an error in pytype.
2018-08-23 17:01:47 -07:00
Tomasz Trębski
50a62b6a6a
Improve werkzeug/exceptions typings ( #2405 )
2018-08-22 08:49:11 -07:00
Sebastian Rittau
a2676ec972
Improve werkzeug stubs ( #2391 )
2018-08-17 08:35:14 -07:00
Devin Fee
047040887b
fix: list_commands returns strings ( #2372 )
...
list_commands previously returned `Iterable[click.Command]` and now returns `Iterable[str]` to comply with the method's return value.
2018-08-09 10:24:23 -07:00
Michael J. Sullivan
0f6f2abc30
Add another undocumented mypy_extension that we are trying out ( #2374 )
2018-08-09 15:57:46 +01:00
Max Murin
e9a7f7cc0d
Add missing protobuf stubs ( #2368 )
...
Added a few stubs to Protobuf descriptors. These appear in descriptor.py. These are all present in https://github.com/google/protobuf/blob/master/python/google/protobuf/descriptor.py .
2018-08-08 09:40:40 +01:00
Michael J. Sullivan
e4656b1ac6
Add undocumented trait decorator to mypy_extensions ( #2369 )
...
`@trait` has special meaning to the experimental mypyc compiler,
slightly restricting the behavior of the class in exchange for
allowing it to be multiply inherited from.
2018-08-07 22:18:00 -07:00
Guido van Rossum
1965e9dd22
Add stub for toml ( #2355 )
...
See https://github.com/uiri/toml/issues/178
2018-08-02 23:02:49 -07:00
Michael J. Sullivan
8b5d4708a0
Change a use of frozenset[int] to FrozenSet[int] ( #2352 )
...
Using FrozenSet is I think preferred (because it works in general) and
I am about to propose a mypy PR that breaks this particular use.
2018-07-31 15:51:14 -07:00
Sebastian Rittau
1c8c6ec7d9
Add type hints to werkzeug's AcceptMixin ( #2349 )
...
* Add type hints to werkzeug's AcceptMixin
* Fix typo
2018-07-28 22:01:56 -07:00
Sebastian Rittau
b5bddc479d
Add werkzeug annotations ( #2339 )
...
* Annotate werkzeug.http
* Annotate werkzeug.datastructures.Authorization
2018-07-20 08:13:32 -07:00
Jelle Zijlstra
7d3ec1e0be
Improvements to pymysql ( #2220 )
...
* don't use type comments
* split up long lines
* all the constants are ints
* fixes to pymysql stub
* drop __all__, fix tabs
2018-07-13 19:43:09 -07:00
Jelle Zijlstra
fc290167eb
Fixes to boto.s3.key stub ( #2317 )
...
* replace type comments in key.pyi
* reformat the file with black
* get_contents_as_string returns bytes unless an encoding is specified
http://boto.cloudhackers.com/en/latest/ref/s3.html#boto.s3.key.Key.get_contents_as_string
2018-07-13 19:39:24 -07:00
David Euresti
99f25d0cd3
Click: Make group and command decorators return the correct types ( #2331 )
2018-07-13 19:23:47 -07:00
Sebastian Rittau
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
Amol Bhave
8000513868
Change return type for click.Context.fail and click.Context.abort to NoReturn ( #2326 )
2018-07-11 20:16:55 -07:00
Amol Bhave
66e9aa644b
Fix type for click.Context.exit ( #2325 )
...
click.Context.exit() calls sys.exit() and hence should be a NoReturn return type.
2018-07-11 19:58:18 -07:00
David Euresti
2899d0a6aa
Make click decorators not modify the type ( #2322 )
2018-07-11 12:35:05 -07:00
Ran Benita
cadacab088
Add missing attributes to the dateutil/relativedelta stub ( #2319 )
...
I have deduced the types from docstring & source code of the
relativedelta class.
Fixes #2269 .
2018-07-10 08:08:39 -07:00
Bertrand Bonnefoy-Claudet
f582b53ff7
Add stub file for click.testing ( #2243 )
...
Click already had stubs but not for the `testing` submodule.
I used stubgen and then narrowed the types when it was easy. I left
`Any` where more work was necessary.
2018-07-05 20:40:48 -07:00
Yusuke Miyazaki
6192cce9d9
Avoid using string literals in type annotations ( #2294 )
2018-07-02 20:23:29 -07:00
Yusuke Miyazaki
581705d9ee
Prefer to use ellipsis over pass ( #2292 )
2018-06-28 10:29:45 -07:00
potykion
f35c5d1349
Jinja2 async support ( #2278 )
2018-06-28 10:24:37 -07:00
Nipunn Koorapati
b7df5a670a
Add type stubs for google.protobuf.service ( #2187 )
2018-06-27 15:38:29 -07:00
Ethan Smith
de1755b263
Remove type cycle in click ( #2277 )
2018-06-26 07:24:55 -07:00
Guido van Rossum
41e5fe4457
Message.WhichOneof returns Text, not bytes ( #2274 )
2018-06-23 15:42:13 -07:00
Jukka Lehtosalo
07374a8251
Fix requests.post signature ( #2256 )
...
The change introduced in 395ab5abd1
broke the signature of `requests.post`, among others, since
`MutableSequence` is invariant, and plain `Dict[str, str]` values
were no longer valid for the `data` argument.
This changes the signature to have `Any` components as a
compromise. Adding more items to the union seems a bit too much, since
the error messages for invalid argument types are already pretty hard to
read.
Another option might be to use `Mapping` instead of `MutableMapping`
due to covariance, but I assume there's a reason why `MutableMapping`
is used here.
2018-06-19 17:08:55 +01:00
Jukka Lehtosalo
feeb4e71ef
Change mock classes to Any values to avoid false positives ( #2255 )
...
The previous definitions in `mock` caused many false positives in
internal Dropbox repositories.
One source of problems was `List[Mock]` not being compatible with
`List[SomeClass]`, since `list` is invariant.
2018-06-19 16:28:19 +01:00
Jukka Lehtosalo
a88d942f91
Add missing protobuf container methods ( #2254 )
...
Implementation of the methods is here:
https://github.com/google/protobuf/blob/master/python/google/protobuf/internal/containers.py
2018-06-19 15:52:54 +01:00
Jelle Zijlstra
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
Anthony Sottile
395ab5abd1
Values of data are Optional ( #2231 )
2018-06-15 07:48:55 -07:00
Bertrand Bonnefoy-Claudet
4b5a63d10f
Fix werkzeug.wrappers.BaseResponse.__init__ ( #2232 )
...
This additionally allows strings, bytearrays and string iterables to be
passed as the `response` argument of `BaseResponse` (and thus also
`Response`).
Strings and bytearrays are explicitly handled in `__init__` [1].
Strings are also featured on the Werkzeug front-page snippet (`'Hello
World!'`) [2].
[1]: https://github.com/pallets/werkzeug/blob/d129d17066768238139b8f8a5d667d9a4f4d68db/werkzeug/wrappers.py#L861
[2]: http://werkzeug.pocoo.org/
2018-06-15 07:24:22 -07:00
Bertrand Bonnefoy-Claudet
15ad132393
Werkzeug stub fixes ( #2229 )
...
* Fix stub for werkzeug.exceptions.Aborter and abort
* `werkzeug.exceptions.abort` [1] was missing and is thus added here.
It's also commonly used in Flask as `flask.abort`.
* They both always raise [2], hence the `NoReturn` return type.
[1]: http://werkzeug.pocoo.org/docs/0.14/exceptions/#werkzeug.exceptions.abort
[2]: https://github.com/pallets/werkzeug/blob/d129d17066768238139b8f8a5d667d9a4f4d68db/werkzeug/exceptions.py#L708-L713
* Fix stub for werkzeug.wrappers.AuthorizationMixin
The code [1] uses `@cached_property` [2], which is basically a Python
property, and optionally returns an `Authorization` [3] object.
[1]: https://github.com/pallets/werkzeug/blob/d129d17066768238139b8f8a5d667d9a4f4d68db/werkzeug/wrappers.py#L1462-L1466
[2]: https://github.com/pallets/werkzeug/blob/d129d17066768238139b8f8a5d667d9a4f4d68db/werkzeug/utils.py#L35
[3]: https://github.com/pallets/werkzeug/blob/d129d17066768238139b8f8a5d667d9a4f4d68db/werkzeug/datastructures.py#L2438
2018-06-14 09:04:18 -07:00
Ilya Konstantinov
978c0913c8
Add stub for first ( #2141 )
...
Reviewed by author in https://github.com/hynek/first/pull/22
2018-06-11 19:50:56 -07:00
Max
a753abafcf
Fix click.getchar return type ( #1473 )
2018-06-11 15:54:56 -07:00
Jelle Zijlstra
764ee4eeec
add pytz.ZERO and pytz.HOUR ( #2180 )
...
https://github.com/stub42/pytz/blob/master/src/pytz/__init__.py#L187
2018-06-11 11:27:34 -07:00
Guido van Rossum
af3b015aa8
mock.patch.object() attribute arg should be Text ( #2210 )
...
It works and is needed for code using the dreaded
'from __future__ import unicode_literals'.
2018-06-09 22:36:24 -07:00
Ilya Konstantinov
129df4957c
pynamodb: fix rate_limited_scan defaults ( #2167 )
...
The `rate_limited_scan` method has defaults for all arguments, including `attributes_to_get` which was omitted.
2018-06-08 23:02:38 -07:00
Max R
34b926008e
Remove Python 3.3 check in mock.pyi ( #2201 )
2018-06-05 15:30:28 -07:00
Max R
1dfe4f2ec7
Add condition argument to pynamodb model delete ( #2182 )
2018-06-05 08:18:46 -07:00
Sebastian Rittau
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
Nipunn Koorapati
b7ee95aa56
Move google.protobuf from 2 to 2and3 ( #2174 )
...
* Move google protobuf from 2 to 2and3
This should generally be ok. I ran the internal consistency
tests and they seemed to pass.
* Convert str to bytes
* repr to use str in google.protobuf.internal.containers
2018-05-31 21:47:11 -07:00
Robert Collins
98badb6eff
Fix mock patch.dict stub and add mock stub ( #2173 )
...
The dict stub was referring to an instance, not the type, leading to
__call__ being considered when using as a decorator, rather than
__init__.
mock is a backport of the stdlib module and should be defined the same.
2018-05-31 21:45:54 -07:00
Cyril Jouve
cedc2d962e
jinja2 loader types ( #2179 )
2018-05-31 21:40:57 -07:00
Michael J. Sullivan
2ba90a65c0
Remove __all__ = ... from stubs ( #2161 )
...
The presence of a __all__ causes everything to not get picked up by
import *, which among other things breaks the new six.moves stubs.
2018-05-24 19:00:07 -07:00
Semyon Proshev
6a080cd0db
Use assignments instead of redefinitions for aliases in attrs ( #2143 )
2018-05-17 20:27:34 -07:00