Danny Weinberg and Jelle Zijlstra
12d60a2760
Allow passing None for gflags default string value ( #2016 )
2018-04-04 16:50:28 -07:00
Alan Du and Jelle Zijlstra
603be5e1da
Fix typehint of click progressbar ( #2003 )
...
* Fix typehint of click progressbar
* Oops -- stubs are *.pyi files
2018-04-03 07:16:17 -07:00
Jelle Zijlstra and Łukasz Langa
371b805c23
improve selenium stubs ( #1732 )
2018-03-28 19:39:43 -07:00
Jelle Zijlstra and Łukasz Langa
0c15e5bdcc
Improve werkzeug stubs ( #1730 )
2018-03-28 19:38:35 -07:00
Michael J. Sullivan and Jelle Zijlstra
eb571e9cbb
Make protobuf's BaseContainer a MutableSequence ( #1981 )
2018-03-22 18:22:59 -07:00
David Euresti and Matthias Kramm
097e9f5e71
Fix issue with attrib ordering. ( #1980 )
...
A call like this:
```
from attr import attrib
from attr.validators import optional, instance_of
c = attrib(default=None, validator=optional(instance_of(bytes)))
```
Was returning no return value, because the first overload was T -> T.
The solution was to change the ordering so that the first overload is
None -> T and infer the type from the other arguments.
2018-03-22 10:50:07 -07:00
Luka Sterbic and Matthias Kramm
89cbd47344
Stubs for termcolor ( #1935 )
2018-03-20 15:32:50 -07:00
Leonardo Fedalto and Jelle Zijlstra
a9cce0c94b
Add requests.utils.set_environ ( #1973 )
2018-03-20 11:15:52 -07:00
Nipunn Koorapati and Jelle Zijlstra
cac7264d3a
Add google.protobuf.internal.containers.pyi to typeshed ( #1718 )
2018-03-17 22:05:43 -07:00
Sebastian Rittau and Jelle 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
Dan Sully and Jelle Zijlstra
ef87943397
Update click.option to allow for user defined kwargs. ( #1950 )
...
Click's option decorator can take a cls= argument, which allows that class to parse arbitrary arguments from the decorator.
2018-03-07 10:32:55 -08:00
David Euresti and Jelle Zijlstra
df65f6ea15
Better type for click 'type' argument ( #1903 )
...
The call accepts tuples of types and callback methods
2018-03-06 21:41:21 -08:00
yed podtrzitko and Jelle Zijlstra
1fe9fd83fa
validator.instance_of can contain sequence of types ( #1920 )
2018-03-06 10:18:33 -08:00
David Euresti and Jelle Zijlstra
50c7188300
Work around mypy issue #4554 in attr.Factory ( #1933 )
...
This makes the following not give a type error:
y: DefaultDict[str, List[int]] = Factory(lambda: defaultdict(list))
2018-03-05 19:21:14 -08:00
Matthias Kramm and Jelle Zijlstra
6c30806d07
add deprecation comment to mypy_extensions ( #1943 )
2018-03-05 18:51:14 -08:00
rchen152 and Matthias 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
Han Song and Jelle Zijlstra
a5c9093edc
Allow requests.post to accept str for data. ( #1922 )
...
```python
import json
url = 'https://api.github.com/some/endpoint '
payload = {'some': 'data'}
r = requests.post(url, data=json.dumps(payload))
```
2018-02-25 22:19:35 -08:00
David Euresti and Jelle Zijlstra
61e63293f1
Work around mypy issue #4554 in attrs. ( #1914 )
2018-02-24 13:00:15 -08:00
Roy Williams and Jelle Zijlstra
8891b02d51
Make update parameters all optional ( #1913 )
...
As of https://github.com/pynamodb/PynamoDB/pull/352 all of these params are optional.
2018-02-23 13:18:55 -08:00
Daniel Bowman and Jelle Zijlstra
1707d8f466
Improve pymysql types ( #1804 )
...
Add all cursor types and missing show_warnings method in connections
Added show_warnings to connections. No return type specified as this
requires tracing back through missing return types in previous
author's work. This is out of scope for this pull request.
Added SSDictCursor, SSCursor and DictCursorMixin to complete the
Cursors definition.
2018-02-16 17:23:17 -08:00
Asim Goheer and Jelle Zijlstra
e7b567c1f4
Issue 1858: pynamodb 3.2.1 added new methods in Attributes which are not in typeshed ( #1859 )
2018-02-16 16:54:45 -08:00
Roy Williams and Jelle Zijlstra
0f36f7ea09
Treat all pynamodb Numbers as floats ( #1895 )
...
Previously we specified this as a Union type, which caused more problems than it helped with, namely when reading data off a Pynamo property
We still had to cast to the appropriate type. Pynamo simply reads the type out of Dynamo, which more closely models a float as it can be an int or a float -
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html
2018-02-16 16:42:32 -08:00
David Euresti and Jelle Zijlstra
fe5e12795f
Fix signature of CaseInsensitiveDict ( #1873 )
...
The values can be more than just strings.
2018-02-11 08:19:39 -08:00
Can Berk Güder and Guido van Rossum
c1c9fac63f
Add tornado.process ( #1870 )
2018-02-09 15:43:22 -08:00
Guido van Rossum and GitHub
40d6faeccd
Ignore thrift imports ( #1869 )
...
Fixes #1868
2018-02-09 09:11:59 -08:00
Chad Dombrova and Jelle Zijlstra
b111a4537f
Add attrs library ( #1838 )
2018-02-02 21:26:35 -08:00
Erwin Janssen and Jelle Zijlstra
b5baedffb7
Add 'message' to click.decorators.version_option ( #1845 )
...
Click's version_option decorator allows the caller to specify the
version message. This optional string option is missing in typeshed.
2018-01-31 16:56:49 -08:00
Carl Meyer and Jelle Zijlstra
1c3ec74d13
Remove incomplete thrift stubs that cause false positives. ( #1827 )
2018-01-26 15:26:14 -08:00
Garrett and Jelle Zijlstra
372b541a07
Fix requests session hooks type ( #1794 )
2018-01-26 14:39:01 -08:00
Sebastian Rittau and Jelle 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
Ivan Levkivskyi and GitHub
c2fa0a153a
Minor improvements to simplejson stubs ( #1832 )
...
This fixes signatures of `load` and `loads` and cleans-up
`JSONDecodeError`.
2018-01-19 22:42:31 +00:00
Roy Williams and Jelle Zijlstra
8175130688
Reexport DoesNotExist from pynamodb.models ( #1809 )
2018-01-10 05:00:39 +08:00
Jelle Zijlstra and Matthias Kramm
fb2c7b34e2
Improve itsdangerous stubs ( #1733 )
2018-01-02 12:50:22 -08:00
Jelle Zijlstra and Matthias Kramm
0eb7083f0e
move dateutil into 2and3 ( #1743 )
...
These stubs are identical since #1735 .
2017-12-23 06:38:55 -08:00
Sebastian Rittau and Jelle Zijlstra
64ca731d0b
jinja2: Add Template.environment ( #1789 )
...
From the docstring for Template: "Template objects created from the
constructor rather than an environment do have an `environment`
attribute that points to a temporary environment ..."
2017-12-17 10:04:53 -08:00
Alex Dehnert and Jelle Zijlstra
8404a62231
requests: add more accurate stubs for certain fields of the Session object ( #1504 )
...
* requests: allow strings in Session.verify
Per the documentation[1] (and actual usage), the verify parameter can be a
string or a bool.
[1] http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification
* requests: explicitly support AuthBase for Session.auth
According to the documentation, the auth parameter should be an AuthBase
subclass[1]. In practice, the actual requirement seems to just be a
Callable[[Request], Request], and AuthBase implements that with the __call__
method. However, mypy isn't currently smart enough to infer that __call__
implies Callable[2]. In the interim (and perhaps also to add clearer errors),
explicitly support AuthBase.
Additionally, this adds typing of AuthBase.__call__, to match the
Callable[[Request], Request] declaration used elsewhere.
[1] http://docs.python-requests.org/en/master/user/advanced/#custom-authentication
[2] https://github.com/python/mypy/issues/797
2017-12-14 21:05:28 -08:00
Roy Williams and Jelle Zijlstra
1dccd1fdc4
Allow requests.post to accept Dict[str, str] for data. ( #1777 )
...
* Allow `requests.post` to accept `Dict[str, str]` for `data`.
For example:
```python
import requests
requests.post('https://www.foo.bar ', data={'hello': 'world'})
```
Failes to type check in Python 2 even though it's fine.
* Explode str/Text combinations
* Fix lint
* Simplify iterable parameter for data
2017-12-14 20:36:21 -08:00
Sebastian Rittau and Jelle Zijlstra
398401baee
werkzeug: Mark BaseRequest.data as property ( #1785 )
2017-12-14 20:35:29 -08:00
Alan Du and Jelle Zijlstra
7c4765357a
Make requests.Response.iter_content allow None ( #1784 )
...
* Make requests.Response.iter_content allow None
According to the docstring:
> chunk_size must be of type int or None
* Combine and alphabetize import statement
2017-12-13 14:25:32 -08:00
Roy Williams and Jelle Zijlstra
10a76c1fdd
Export Connection and TableConnection from pynamodb.connection ( #1779 )
...
It looks like in recent versions of mypy this stopped being exported.
2017-12-07 14:35:13 -08:00
Guido van Rossum and Jelle Zijlstra
821c765991
Several packages always auto-import certain submodules on import ( #1752 )
...
* Importing yaml implies yaml.resolver
* Importing six implies six.moves
* Importing requests implies requests.packages
2017-11-17 15:15:40 -08:00
Jelle Zijlstra and Matthias Kramm
533a05be45
Fix some of the last default values that are not ... ( #1731 )
...
* still one left in atomicwrites that I need to investigate further
* fix atomicwrites
2017-11-13 07:08:30 -08:00
Jelle Zijlstra and Matthias Kramm
69bffd154a
Fix default values in click stubs to ... ( #1734 )
2017-11-13 07:07:20 -08:00
Jelle Zijlstra and Matthias Kramm
8e75701eda
make Python 2 and 3 dateutil stubs identical ( #1735 )
...
So that they can be merged into 2and3. This PR also adds a few missing
elements to parser.pyi and corrects some mistakes in the Python 3 stub.
Refer to https://github.com/dateutil/dateutil/tree/master/dateutil
2017-11-13 07:06:34 -08:00
Jelle Zijlstra and Matthias Kramm
84d0cbf776
move thrift to 2and3 ( #1736 )
...
thrift supports Python 3 as of version 0.10.0. These stubs are pure stubgen and
might not be much good, but they belong in 2and3.
2017-11-13 07:05:57 -08:00
Jelle Zijlstra and Matthias Kramm
bcfd3bf554
Fill out croniter stubs and move to 2and3 ( #1737 )
...
* fill out croniter stub
* move to 2and3
2017-11-13 07:05:38 -08:00
Jelle Zijlstra and Matthias Kramm
83ca997140
Change more defaults to ... ( #1729 )
...
* codemod ': Any = None' ': Any = ...'
* codemod ': (Union|Optional)([^=]+)\s+=\s+-?\d+' ': \1\2 = ...'
* codemod ': (Union|Optional)([^=]+)\s*=\s*-?(None|False|True)' ': \1\2 = ...'
* codemod ': (int|float|bool)\s*=\s*-?\d+' ': \1 = ...'
* codemod ': (bool)\s*=\s*(False|True)' ': \1 = ...'
* codemod ': Any\s*=\s*(False|True|None)' ': Any = ...'
2017-11-13 06:56:24 -08:00
Jelle Zijlstra and Matthias Kramm
324f1761f4
Change more defaults to ... ( #1727 )
2017-11-09 10:32:17 -08:00
Jelle Zijlstra and Matthias Kramm
54dd6ba27c
Change numerous default values to ... ( #1722 )
...
This is the convention, and some default values (e.g. strings) apparently
break pytype.
2017-11-09 06:28:40 -08:00
Brandon W Maister and Jelle Zijlstra
a1238294d7
Remove unnecessary optionality for requests.Session ( #1658 )
...
Current code that initializes the things I've changed, to demonstrate that the
object is initialized this way:
* headers: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L345
* proxies: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L354
* hooks: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L357
* params: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L362
* cookies: https://github.com/requests/requests/blob/9713289e74/requests/sessions.py#L388
from what I can tell nothing in the official requests API ever creates a
session other than through `__init__`.
2017-11-08 19:53:56 -08:00