Skip to content

Commit f962c94

Browse files
authored
Merge pull request #49 from common-workflow-language/mypy3
Add py3 typesheds & testing
2 parents 9cca425 + 15d6a67 commit f962c94

File tree

165 files changed

+4772
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+4772
-53
lines changed

Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,28 @@ list-author-emails:
147147
@echo 'name, E-Mail Address'
148148
@git log --format='%aN,%aE' | sort -u | grep -v 'root'
149149

150-
mypy: ${PYSOURCES}
150+
mypy2: ${PYSOURCES}
151151
rm -Rf typeshed/2.7/ruamel/yaml
152152
ln -s $(shell python -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
153153
typeshed/2.7/ruamel/yaml
154154
rm -Rf typeshed/2.7/schema_salad
155155
ln -s $(shell python -c 'from __future__ import print_function; import schema_salad; import os.path; print(os.path.dirname(schema_salad.__file__))') \
156156
typeshed/2.7/schema_salad
157-
MYPYPATH=typeshed/2.7 mypy --py2 --disallow-untyped-calls \
157+
MYPYPATH=typeshed/2.7:typeshed/2and3 mypy --py2 --disallow-untyped-calls \
158158
--warn-redundant-casts --warn-unused-ignores \
159159
${MODULE}
160160

161+
mypy3: ${PYSOURCES}
162+
rm -Rf typeshed/2and3/ruamel/yaml
163+
ln -s $(shell python3 -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
164+
typeshed/2and3/ruamel/yaml
165+
rm -Rf typeshed/2and3/schema_salad
166+
ln -s $(shell python3 -c 'from __future__ import print_function; import schema_salad; import os.path; print(os.path.dirname(schema_salad.__file__))') \
167+
typeshed/2and3/schema_salad
168+
MYPYPATH=$$MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
169+
--warn-redundant-casts \
170+
${MODULE}
171+
161172
release: FORCE
162173
./release-test.sh
163174
. testenv2/bin/activate && \

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[mypy-ruamel.*]
2-
ignore_errors = True
2+
ignore_errors = True

tox.ini

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
[tox]
22
#envlist = py35-lint,py34-lint,py33-lint,py27-lint,py35-unit,py34-unit,py33-unit,py27-unit
3-
envlist = py27-lint, py27-unit, py35-mypy
3+
envlist = py27-lint, py27-unit, py35-mypy{2,3}
44
skipsdist = True
55

66
[travis]
77
os =
8-
linux: py{27,35}-{lint,unit}, py35-mypy
8+
linux: py{27,35}-{lint,unit}, py35-mypy{2,3}
99
osx: py{27}-{lint,unit}
1010
python =
1111
2.7: py27
12-
3.5: py35-mypy
12+
3.5: py35-mypy{2,3}
1313

1414
[testenv]
1515
deps = -rrequirements.txt
1616

17-
[testenv:py35-mypy]
18-
commands = make mypy
17+
[testenv:py35-mypy2]
18+
commands = make mypy2
1919
whitelist_externals = make
2020
deps =
21-
mypy==0.520
21+
mypy==0.560
22+
-rrequirements.txt
23+
24+
[testenv:py35-mypy3]
25+
commands = make mypy3
26+
whitelist_externals = make
27+
deps =
28+
mypy==0.560
2229
-rrequirements.txt
2330

2431
[testenv:py35-lint]

typeshed/2.7/junit_xml.pyi

Lines changed: 0 additions & 44 deletions
This file was deleted.

typeshed/2and3/avro/__init__.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Stubs for avro (Python 2)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
# Names in __all__ with no definition:
6+
# datafile
7+
# io
8+
# ipc
9+
# protocol
10+
# schema

typeshed/2and3/avro/schema.pyi

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Stubs for avro.schema (Python 2)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any, Union, Dict, List, Text
6+
7+
PRIMITIVE_TYPES = ... # type: Any
8+
NAMED_TYPES = ... # type: Any
9+
VALID_TYPES = ... # type: Any
10+
SCHEMA_RESERVED_PROPS = ... # type: Any
11+
FIELD_RESERVED_PROPS = ... # type: Any
12+
VALID_FIELD_SORT_ORDERS = ... # type: Any
13+
14+
class AvroException(Exception): ...
15+
class SchemaParseException(AvroException): ...
16+
17+
class Schema:
18+
type = ... # type: Any
19+
def __init__(self, type, other_props=None): ...
20+
props = ... # type: Any
21+
other_props = ... # type: Any
22+
def get_prop(self, key): ...
23+
def set_prop(self, key, value): ...
24+
def to_json(self, names): ...
25+
26+
class Name:
27+
def __init__(self, name_attr, space_attr, default_space): ...
28+
def __eq__(self, other): ...
29+
fullname = ... # type: Any
30+
def get_space(self): ...
31+
32+
class Names:
33+
names = ... # type: Any
34+
default_namespace = ... # type: Any
35+
def __init__(self, default_namespace: Union[str, Text] = None) -> None: ...
36+
def has_name(self, name_attr: Union[str, Text], space_attr: Union[str, Text]) -> bool: ...
37+
def get_name(self, name_attr: Union[str, Text], space_attr: Union[str, Text]) -> Schema: ...
38+
def prune_namespace(self, properties): ...
39+
def add_name(self, name_attr, space_attr, new_schema): ...
40+
41+
class NamedSchema(Schema):
42+
def __init__(self, type, name, namespace=None, names=None, other_props=None): ...
43+
def name_ref(self, names): ...
44+
name = ... # type: Any
45+
namespace = ... # type: Any
46+
fullname = ... # type: Any
47+
48+
class Field:
49+
type = ... # type: Any
50+
name = ... # type: Any
51+
def __init__(self, type, name, has_default, default=None, order=None, names=None, doc=None, other_props=None): ...
52+
default = ... # type: Any
53+
has_default = ... # type: Any
54+
order = ... # type: Any
55+
doc = ... # type: Any
56+
props = ... # type: Any
57+
other_props = ... # type: Any
58+
def get_prop(self, key): ...
59+
def set_prop(self, key, value): ...
60+
def to_json(self, names=None): ...
61+
def __eq__(self, that): ...
62+
63+
class PrimitiveSchema(Schema):
64+
fullname = ... # type: Any
65+
def __init__(self, type, other_props=None): ...
66+
def to_json(self, names=None): ...
67+
def __eq__(self, that): ...
68+
69+
class FixedSchema(NamedSchema):
70+
def __init__(self, name, namespace, size, names=None, other_props=None): ...
71+
size = ... # type: Any
72+
def to_json(self, names=None): ...
73+
def __eq__(self, that): ...
74+
75+
class EnumSchema(NamedSchema):
76+
def __init__(self, name, namespace, symbols, names=None, doc=None, other_props=None): ...
77+
symbols = ... # type: Any
78+
doc = ... # type: Any
79+
def to_json(self, names=None): ...
80+
def __eq__(self, that): ...
81+
82+
class ArraySchema(Schema):
83+
def __init__(self, items, names=None, other_props=None): ...
84+
items = ... # type: Any
85+
def to_json(self, names=None): ...
86+
def __eq__(self, that): ...
87+
88+
class MapSchema(Schema):
89+
def __init__(self, values, names=None, other_props=None): ...
90+
values = ... # type: Any
91+
def to_json(self, names=None): ...
92+
def __eq__(self, that): ...
93+
94+
class UnionSchema(Schema):
95+
def __init__(self, schemas, names=None): ...
96+
schemas = ... # type: Any
97+
def to_json(self, names=None): ...
98+
def __eq__(self, that): ...
99+
100+
class ErrorUnionSchema(UnionSchema):
101+
def __init__(self, schemas, names=None): ...
102+
def to_json(self, names=None): ...
103+
104+
class RecordSchema(NamedSchema):
105+
@staticmethod
106+
def make_field_objects(field_data, names): ...
107+
def __init__(self, name, namespace, fields, names=None, schema_type='', doc=None, other_props=None): ...
108+
fields = ... # type: Any
109+
doc = ... # type: Any
110+
@property
111+
def fields_dict(self): ...
112+
def to_json(self, names=None): ...
113+
def __eq__(self, that): ...
114+
115+
def get_other_props(all_props, reserved_props): ...
116+
def make_avsc_object(json_data: Union[Dict, List, str], names: Names) -> Schema: ...
117+
def parse(json_string): ...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Stubs for cachecontrol (Python 2)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any
6+
from .wrapper import CacheControl as CacheControl
7+
#from .adapter import CacheControlAdapter as CacheControlAdapter
8+
#from .controller import CacheController as CacheController
9+
10+
__email__ = ... # type: Any
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Stubs for cachecontrol.adapter (Python 2)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any
6+
from requests.adapters import HTTPAdapter
7+
from .controller import CacheController as CacheController
8+
from .cache import DictCache as DictCache
9+
from .filewrapper import CallbackFileWrapper as CallbackFileWrapper
10+
11+
class CacheControlAdapter(HTTPAdapter):
12+
invalidating_methods = ... # type: Any
13+
cache = ... # type: Any
14+
heuristic = ... # type: Any
15+
controller = ... # type: Any
16+
def __init__(self, cache=None, cache_etags=True, controller_class=None, serializer=None, heuristic=None, *args, **kw): ...
17+
def send(self, request, **kw): ...
18+
def build_response(self, request, response, from_cache=False): ...
19+
def close(self): ...

typeshed/2and3/cachecontrol/cache.pyi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Stubs for cachecontrol.cache (Python 2)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any
6+
7+
class BaseCache:
8+
def get(self, key): ...
9+
def set(self, key, value): ...
10+
def delete(self, key): ...
11+
def close(self): ...
12+
13+
class DictCache(BaseCache):
14+
lock = ... # type: Any
15+
data = ... # type: Any
16+
def __init__(self, init_dict=None): ...
17+
def get(self, key): ...
18+
def set(self, key, value): ...
19+
def delete(self, key): ...
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Stubs for cachecontrol.caches (Python 2)
2+
#
3+
# NOTE: This dynamically typed stub was automatically generated by stubgen.
4+
5+
from typing import Any
6+
from .file_cache import FileCache as FileCache
7+
#from .redis_cache import RedisCache as RedisCache
8+
9+
notice = ... # type: Any

0 commit comments

Comments
 (0)