From 7a5138d91bcfb18a892ef19091c20c5c7cfb2832 Mon Sep 17 00:00:00 2001 From: Nikolaus Waxweiler Date: Wed, 16 Sep 2020 15:13:50 +0100 Subject: [PATCH] Add mypy CI job --- .travis.yml | 3 +++ dev-requirements.txt | 1 + mypy.ini | 21 +++++++++++++++++++++ tox.ini | 9 ++++++++- 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 mypy.ini diff --git a/.travis.yml b/.travis.yml index 7ff7e3160..389d3372c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,9 @@ branches: matrix: fast_finish: true include: + - python: 3.6 + env: + - TOXENV=mypy - python: 3.6 env: - TOXENV=py36-cov,package_readme diff --git a/dev-requirements.txt b/dev-requirements.txt index a34deb2e9..6ebb76bf5 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,3 +2,4 @@ pytest>=3.0 tox>=2.5 bump2version>=0.5.6 sphinx>=1.5.5 +mypy diff --git a/mypy.ini b/mypy.ini new file mode 100644 index 000000000..7e37b03fb --- /dev/null +++ b/mypy.ini @@ -0,0 +1,21 @@ +[mypy] +python_version = 3.6 +files = Lib/fontTools/misc/plistlib +follow_imports = silent +ignore_missing_imports = True +warn_redundant_casts = True +warn_unused_configs = True +warn_unused_ignores = True + +[mypy-fontTools.misc.plistlib] +check_untyped_defs = True +disallow_any_generics = True +disallow_incomplete_defs = True +disallow_subclassing_any = True +disallow_untyped_decorators = True +disallow_untyped_calls = False +disallow_untyped_defs = True +no_implicit_optional = True +no_implicit_reexport = True +strict_equality = True +warn_return_any = True diff --git a/tox.ini b/tox.ini index df6358c2e..5a8d9f209 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.0 -envlist = py3{6,7,8}-cov, htmlcov +envlist = mypy, py3{6,7,8}-cov, htmlcov skip_missing_interpreters=true [testenv] @@ -33,6 +33,13 @@ commands = coverage combine coverage html +[testenv:mypy] +deps = + -r dev-requirements.txt +skip_install = true +commands = + mypy + [testenv:codecov] passenv = * deps =