Skip to content

Commit c6bc1b4

Browse files
committed
Add mypy to the build
1 parent 1c0c453 commit c6bc1b4

File tree

4 files changed

+75
-3
lines changed

4 files changed

+75
-3
lines changed

.github/workflows/testing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Code check
4242
run: tox -e ${TOX_VENV}
4343
env:
44-
TOX_VENV: black,pep8
44+
TOX_VENV: black,pep8,mypy
4545

4646
test:
4747
needs: [validate]

mypy.ini

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
[mypy]
2+
3+
# TODO: For details on each flag, please see the mypy documentation at:
4+
# https://mypy.readthedocs.io/en/stable/config_file.html#config-file
5+
6+
# Import Discovery
7+
# FIXME: disable ignore_missing_imports
8+
ignore_missing_imports = true
9+
10+
# Disallow dynamic typing
11+
# FIXME: enable disallow_any_generics
12+
disallow_any_generics = false
13+
# FIXME: enable disallow_subclassing_any
14+
disallow_subclassing_any = false
15+
16+
# Untyped definitions and calls
17+
# FIXME: enable disallow_untyped_calls
18+
disallow_untyped_calls = false
19+
# FIXME: enable disallow_untyped_defs
20+
disallow_untyped_defs = false
21+
disallow_incomplete_defs = true
22+
# FIXME: enable check_untyped_defs
23+
check_untyped_defs = false
24+
disallow_untyped_decorators = true
25+
26+
# None and Optional handling
27+
# FIXME: disable implicit_optional
28+
implicit_optional = true
29+
# FIXME: enable strict_optional
30+
strict_optional = false
31+
32+
# Configuring warnings
33+
warn_redundant_casts = true
34+
warn_unused_ignores = true
35+
warn_no_return = true
36+
warn_return_any = true
37+
warn_unreachable = true
38+
39+
# Miscellaneous strictness flags
40+
# FIXME: disable implicit_reexport
41+
implicit_reexport = true
42+
# FIXME: enable strict_equality
43+
strict_equality = false
44+
45+
# Configuring error messages
46+
show_error_context = true
47+
show_column_numbers = true
48+
show_error_codes = true
49+
pretty = true
50+
color_output = true
51+
show_absolute_path = true
52+
53+
# Miscellaneous
54+
# FIXME: disable allow_untyped_globals
55+
allow_untyped_globals = true
56+
warn_unused_configs = true
57+
verbosity = 0
58+
59+
# FIXME: remove this section
60+
[mypy-kazoo.tests.util,kazoo.exceptions]
61+
ignore_errors = true

setup.cfg

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,14 @@ sasl =
7373
docs =
7474
Sphinx>=1.2.2
7575

76+
typing =
77+
mypy>=0.991
78+
7679
alldeps =
7780
%(dev)s
7881
%(eventlet)s
7982
%(gevent)s
8083
%(sasl)s
8184
%(docs)s
82-
85+
%(typing)s
8386

tox.ini

+9-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires=
44
virtualenv>=20.7.2
55
skip_missing_interpreters=True
66
envlist =
7-
pep8,black,
7+
pep8,black,mypy,
88
gevent,eventlet,sasl,
99
docs,
1010
pypy3
@@ -59,3 +59,11 @@ deps =
5959
usedevelop = True
6060
commands = black --check {posargs: {toxinidir}/kazoo {toxinidir}/kazoo}
6161

62+
[testenv:mypy]
63+
basepython = python3
64+
extras = alldeps
65+
deps =
66+
mypy
67+
mypy: types-mock
68+
usedevelop = True
69+
commands = mypy --config-file {toxinidir}/mypy.ini {toxinidir}/kazoo

0 commit comments

Comments
 (0)