Skip to content

Commit 77f9e61

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

File tree

5 files changed

+64
-4
lines changed

5 files changed

+64
-4
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
namespace_packages = false
8+
# FIXME: disable ignore_missing_imports
9+
ignore_missing_imports = true
10+
# FIXME: remove excludes
11+
exclude = ['tests/']
12+
13+
# Disallow dynamic typing
14+
# FIXME: enable disallow_any_generics
15+
disallow_any_generics = false
16+
disallow_subclassing_any = true
17+
18+
# Untyped definitions and calls
19+
# FIXME: enable disallow_untyped_calls
20+
disallow_untyped_calls = false
21+
# FIXME: enable disallow_untyped_defs
22+
disallow_untyped_defs = false
23+
disallow_incomplete_defs = true
24+
# FIXME: enable check_untyped_defs
25+
check_untyped_defs = false
26+
disallow_untyped_decorators = true
27+
28+
# None and Optional handling
29+
no_implicit_optional = true
30+
31+
# Configuring warnings
32+
warn_redundant_casts = true
33+
warn_unused_ignores = true
34+
warn_no_return = true
35+
warn_return_any = true
36+
warn_unreachable = true
37+
38+
# Miscellaneous strictness flags
39+
implicit_reexport = false
40+
strict_equality = true
41+
42+
# Configuring error messages
43+
show_error_context = true
44+
show_column_numbers = true
45+
show_error_codes = true
46+
pretty = true
47+
show_absolute_path = true
48+
49+
# Miscellaneous
50+
warn_unused_configs = true
51+
verbosity = 0

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ build-backend = 'setuptools.build_meta'
33
requires = [
44
'setuptools >= 46.4.0',
55
]
6-
76
[tool.black]
87
line-length = 79
98
target-version = ['py37', 'py38', 'py39', 'py310']

setup.cfg

Lines changed: 4 additions & 1 deletion
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

Lines changed: 8 additions & 1 deletion
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,10 @@ 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+
usedevelop = True
68+
commands = mypy --config-file {toxinidir}/mypy.ini -p kazoo

0 commit comments

Comments
 (0)