diff --git a/pylint.rc b/pylint.rc index b2bbf8f1..ac9beaf8 100755 --- a/pylint.rc +++ b/pylint.rc @@ -26,6 +26,7 @@ load-plugins= # can either give multiple identifier separated by comma (,) or put this option # multiple time (only on the command line, not in the configuration file where # it should appear only once). +# W0107 unnecessary-pass # W0201 attribute-defined-outside-init # W0212 protected-access var starting with _ used outside class or descendant # W0221 arguments-differ @@ -37,8 +38,13 @@ load-plugins= # E0202 method-hidden # E0203 access-member-before-definition # E1101 no-member -disable=C, R, W0201, W0212, W0221, W0235, W0403, W0511, W0613, W0703, - E0202, E0203, E1101 +# The next two error codes are because Django 1.11.20 cannot be specified +# without a custom upper constraints file +# E0401: Unable to import 'django.core.urlresolvers' (import-error) +# E0611: No name 'urlresolvers' in module 'django.core' (no-name-in-module) +disable=C, R, W0107, W0201, W0212, W0221, W0235, W0403, W0511, W0613, W0703, + E0202, E0203, E1101, + E0401, E0611 [REPORTS] diff --git a/test-requirements.txt b/test-requirements.txt index d062adbf..0ee31f18 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,11 +7,10 @@ # be installed in a specific order. # # Hacking should appear first in case something else depends on pep8 -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +hacking>=1.1.0,<=2.0.0 # Apache-2.0 coverage>=3.6 # Apache-2.0 django-nose>=1.4.4 # BSD mock>=2.0 # BSD -mox3>=0.7.0 # Apache-2.0 nodeenv>=0.9.4 # BSD License # BSD nose # LGPL nose-exclude # LGPL @@ -24,4 +23,8 @@ testtools>=1.4.0 # MIT # This also needs xvfb library installed on your OS xvfbwrapper>=0.1.3 #license: MIT pyOpenSSL>=0.14 -bandit!=1.6.0,>=1.1.0,<2.0.0 +bandit;python_version>="3.0" +isort<5;python_version>="3.0" +pylint<2.1.0;python_version<"3.0" # GPLv2 +pylint<2.4.0;python_version>="3.0" # GPLv2 +Django diff --git a/tox.ini b/tox.ini index ba4949f4..239f123b 100644 --- a/tox.ini +++ b/tox.ini @@ -37,9 +37,11 @@ commands = [flake8] # H102 Apache 2.0 license header not found -# NOTE(Eric Barrett): H102 raises a false positive when using the SPDX license header -ignore = H102 -# H106 Don’t put vim configuration in source files (off by default). +# W503 line break before binary operator +# W504 line break after binary operator +# E741 ambiguous variable name 'l' +ignore = H102,W503,W504,E741 +# H106 Do not put vim configuration in source files (off by default). # H203 Use assertIs(Not)None to check for None (off by default). # H904 Delay string interpolations at logging calls (off by default). enable-extensions = H106,H203,H904 @@ -52,7 +54,7 @@ commands = flake8 [testenv:pylint] -basepython = python2.7 +basepython = python3 usedevelop = False skip_install = True deps = {[testenv]deps} @@ -64,9 +66,8 @@ deps = {[testenv]deps} -e{[tox]stxdir}/nfv/nfv/nfv-client -e{[tox]stxdir}/ha/service-mgmt-client/sm-client -e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient - horizon==15.2.0 + horizon requests-toolbelt - pylint commands = pylint starlingx-dashboard/starlingx-dashboard/starlingx_dashboard --rcfile=./pylint.rc @@ -77,6 +78,7 @@ commands = {posargs} [testenv:docs] basepython = python3 deps = -r{toxinidir}/doc/requirements.txt +install_command = pip install -U {opts} {packages} commands = rm -rf doc/build sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html @@ -85,6 +87,7 @@ whitelist_externals = rm [testenv:releasenotes] basepython = python3 deps = -r{toxinidir}/doc/requirements.txt +install_command = pip install -U {opts} {packages} commands = rm -rf releasenotes/build sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html @@ -97,10 +100,10 @@ basepython = python3 # Re-use the releasenotes venv envdir = {toxworkdir}/releasenotes deps = -r{toxinidir}/doc/requirements.txt +install_command = pip install -U {opts} {packages} commands = reno new {posargs} [testenv:bandit] basepython = python3 description = Bandit code scan for *.py files under config folder -deps = -r{toxinidir}/test-requirements.txt commands = bandit -r {toxinidir}/ -x '**/.tox/**,**/.eggs/**' -lll