Add mypy test to tox
@@ -57,10 +57,11 @@ test = [
"pympler",
]
check = [
+ "mypy>=0.990",
"flake8<6",
"flake8-black",
"flake8-colors",
- "flake8-isort>=4.2.0",
+ "flake8-isort>=4.2.0,<5.0.0",
"flake8-pyi",
"flake8-typing-imports",
"docutils",
@@ -121,10 +122,34 @@ use_parentheses = true
ensure_newline_before_comments = true
[tool.mypy]
-warn_redundant_casts = true
-warn_unused_ignores = true
+# Untyped definitions and calls are disable in default
+check_untyped_defs = false
+disallow_incomplete_defs = false
+disallow_untyped_calls = false
+disallow_untyped_defs = false
+disallow_untyped_decorators = false
+# not a all 3rd party package has type hints
+ignore_missing_imports = true
+# Optional check: implicit check enabled in mypy 0.980 or before
strict_optional = true
+implicit_optional = false
+# Enable incremental mode and use sqlite cache
+incremental = true
+sqlite_cache = true
+# Enables PEP 420 style namespace packages
+namespace_packages = true
+# Control error output
+pretty = true
+color_output = true
+show_error_context = false
show_column_numbers = true
+error_summary = true
+# configuring warnings
+warn_no_return = true
+warn_redundant_casts = true
+warn_return_any = true
+warn_unreachable = true
+warn_unused_ignores = true
[tool.pytest.ini_options]
minversion = "6.0"
@@ -141,7 +166,7 @@ markers = [
[tool.tox]
legacy_tox_ini = """
[tox]
-envlist = check, docs, py{37,38,39,310,311}, py39d, mprof, fil
+envlist = check, docs, py{37,38,39,310,311}, py39d, mprof, fil, mypy
isolated_build = True
[testenv]
@@ -162,6 +187,15 @@ commands =
check-manifest {toxinidir}
flake8 aqt tests
+[testenv:mypy]
+basepython = python3.9
+extras = check
+commands = mypy aqt
+deps =
+ types-requests
+ types-beautifulsoup4
+ types-psutil
+
[testenv:docs]
basepython = python3.9
extras = docs
@@ -207,7 +241,7 @@ commands =
[gh-actions]
python =
3.8: py38, docs, check
- 3.9: py39
+ 3.9: py39, mypy
3.10: py310
3.11: py311
"""
