Skip to content

Commit

Permalink
chore: add intial mypy testing in preparation for type-hints
Browse files Browse the repository at this point in the history
Related to mjs#463
  • Loading branch information
JohnVillalovos committed Aug 20, 2023
1 parent b9284e4 commit 92ae49a
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,67 @@
profile = "black"
multi_line_output = 3
order_by_type = false

[tool.mypy]
files = "."
exclude = [
"doc/.*",
"examples/.*",
"tests/.*",
]

show_error_codes = true

# 'strict = true' is equivalent to:
# --check-untyped-defs
# --disallow-any-generics
# --disallow-incomplete-defs
# --disallow-subclassing-any
# --disallow-untyped-calls
# --disallow-untyped-decorators
# --disallow-untyped-defs
# --extra-checks
# --no-implicit-reexport
# --strict-equality
# --warn-redundant-casts
# --warn-return-any
# --warn-unused-configs
# --warn-unused-ignores

check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
extra_checks = true
no_implicit_reexport = true
strict_equality = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

# Overrides for currently untyped modules
[[tool.mypy.overrides]]
module = [
"imapclient.config",
"imapclient.datetime_util",
"imapclient.fixed_offset",
"imapclient.imap4",
"imapclient.imap_utf7",
"imapclient.imapclient",
"imapclient.interact",
"imapclient.response_lexer",
"imapclient.response_parser",
"imapclient.response_types",
"imapclient.testable_imapclient",
"imapclient.tls",
"imapclient.util",
"imapclient.version",
"interact",
"livetest",
"setup",
]
ignore_errors = true
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ sphinx
black==22.3.0
flake8==4.0.1
isort==5.12.0
mypy==1.5.1
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
skipsdist = True
minversion = 3.0
envlist=py37,py38,py39,py310,py311,black,isort,flake8
envlist=py37,py38,py39,py310,py311,black,isort,flake8,mypy

[testenv]
commands=python -m unittest
Expand All @@ -22,6 +22,11 @@ basepython = python3
commands =
isort {posargs} .

[testenv:mypy]
basepython = python3
commands =
mypy {posargs}

[flake8]
exclude = .git,.venv,.tox,dist,doc,*egg,build,
max-line-length = 88
Expand Down

0 comments on commit 92ae49a

Please sign in to comment.