diff --git a/api_core/nox.py b/api_core/nox.py index dacfbb53e74d..7d14ad9befb1 100644 --- a/api_core/nox.py +++ b/api_core/nox.py @@ -15,7 +15,8 @@ from __future__ import absolute_import import os -import nox +# https://github.com/google/importlab/issues/25 +import nox # pytype: disable=import-error @nox.session @@ -108,6 +109,19 @@ def lint_setup_py(session): 'python', 'setup.py', 'check', '--restructuredtext', '--strict') +# No 2.7 due to https://github.com/google/importlab/issues/26. +# No 3.7 because pytype supports up to 3.6 only. +@nox.session +def pytype(session): + """Run type-checking.""" + session.interpreter = 'python3.6' + session.install('.', + 'grpcio >= 1.8.2', + 'grpcio-gcp >= 0.2.2', + 'pytype >= 2018.9.26') + session.run('pytype') + + @nox.session def cover(session): """Run the final coverage report. diff --git a/api_core/setup.cfg b/api_core/setup.cfg index 2a9acf13daa9..046436b8c99f 100644 --- a/api_core/setup.cfg +++ b/api_core/setup.cfg @@ -1,2 +1,9 @@ [bdist_wheel] universal = 1 + +[pytype] +python_version = 3.6 +inputs = + . +exclude = + tests/