From 8b41507c2c1e96ccb4e28bf2709b18a6bde2a547 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Thu, 3 Jun 2021 00:44:17 +0000 Subject: [PATCH] Enable bare minimum pytype + GHA (no ryu code changes). Exclusions/ignored errors can be incrementally removed, to manage diff size and risk. --- setup.cfg | 11 +++++++++++ tools/test-requires | 1 + tox.ini | 12 ++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index b3716c1c..96208014 100644 --- a/setup.cfg +++ b/setup.cfg @@ -55,3 +55,14 @@ setup-hooks = console_scripts = ryu-manager = ryu.cmd.manager:main ryu = ryu.cmd.ryu_base:main + +[pytype] +inputs = + ryu/controller/ +disable = + attribute-error + import-error + key-error + module-attr +keep-going = + 1 diff --git a/tools/test-requires b/tools/test-requires index e0503381..dfef2215 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -4,4 +4,5 @@ mock nose pycodestyle pylint +pytype formencode diff --git a/tox.ini b/tox.ini index 37b95397..04ebe1c1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] -envlist = py35,py36,py37,py38,py39,pypy,pycodestyle,autopep8 +envlist = py35,py36,py37,py38,py39,pypy,pycodestyle,autopep8,pytype [gh-actions] python = 3.5: py35 - 3.6: py36, pycodestyle, autopep8 + 3.6: py36, pycodestyle, autopep8, pytype 3.7: py37 3.8: py38 3.9: py39 @@ -53,6 +53,14 @@ deps = commands = bash -c 'test -z "$(autopep8 --recursive --diff ryu/)"' +[testenv:pytype] +deps = + -U + --no-cache-dir + pytype +commands = + pytype --jobs 2 + [pycodestyle] exclude = pbr-*,.venv,.tox,.git,doc,dist,tools,vcsversion.py,.pyc,ryu/contrib # W503: line break before binary operator