From bb96242adf3d5f95ed01ccc355d80fdb5591985e Mon Sep 17 00:00:00 2001 From: albailey Date: Fri, 18 Dec 2020 13:18:59 -0600 Subject: [PATCH] Fix zuul jobs broken due to pip upversion The bandit defined in base level test-requirements.txt needed to be restricted to python3. The version of hacking was conflicting. Updated pylint to be python3. The newer hacking pulls in some additional flake8 warnings which are being suppressed for now. The gettextutils has per line suppressions based on the new version of pylint, however that file should be removed in favor of a solution based on oslo.i18n. The multiple test-requirements.txt files should be revisited. Change-Id: I9de0ad5871865fc3baf79f89e3f9f6bedc523e05 Partial-Bug: #1907678 Signed-off-by: albailey --- .../dcmanagerclient/openstack/common/gettextutils.py | 4 ++-- distributedcloud-client/pylint.rc | 8 +++++--- distributedcloud-client/test-requirements.txt | 7 ++++--- distributedcloud-client/tox.ini | 6 ++++-- test-requirements.txt | 3 ++- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/distributedcloud-client/dcmanagerclient/openstack/common/gettextutils.py b/distributedcloud-client/dcmanagerclient/openstack/common/gettextutils.py index 61fc891..65c0262 100644 --- a/distributedcloud-client/dcmanagerclient/openstack/common/gettextutils.py +++ b/distributedcloud-client/dcmanagerclient/openstack/common/gettextutils.py @@ -195,7 +195,7 @@ def install(domain, lazy=False): gettext.install(domain, localedir=os.environ.get(localedir)) else: - gettext.install(domain, + gettext.install(domain, # pylint: disable=unexpected-keyword-arg localedir=os.environ.get(localedir), unicode=True) @@ -208,7 +208,7 @@ class Message(six.text_type): and can be treated as such. """ - def __new__(cls, msgid, msgtext=None, params=None, + def __new__(cls, msgid, msgtext=None, params=None, # pylint: disable=keyword-arg-before-vararg domain='dcmanagerclient', *args): """Create a new Message object. diff --git a/distributedcloud-client/pylint.rc b/distributedcloud-client/pylint.rc index 9d3720d..656d921 100644 --- a/distributedcloud-client/pylint.rc +++ b/distributedcloud-client/pylint.rc @@ -37,6 +37,7 @@ load-plugins= # R detect Refactor for a "good practice" metric violation # C detect Convention for coding standard violation # W0102: dangerous-default-value +# W0107: unnecessary-pass # W0201: attribute-defined-outside-init # W0212: protected-access # W0231: super-init-not-called @@ -47,12 +48,13 @@ load-plugins= # W0621: redefined-outer-name # W0622: redefined-builtin # W0703: broad-except -# W1201: logging-not-lazy # W1113: keyword-arg-before-vararg +# W1201: logging-not-lazy +# W1505: deprecated-method # E1102: not-callable disable=fixme,C,R, - W0102,W0201,W0212,W0231,W0403, - W0612,W0613,W0603,W0621,W0622,W0703,W1201,W1113, + W0102,W0107,W0201,W0212,W0231,W0403, + W0612,W0613,W0603,W0621,W0622,W0703,W1112,W1201,W1505, E1102 [REPORTS] diff --git a/distributedcloud-client/test-requirements.txt b/distributedcloud-client/test-requirements.txt index 42a93bb..318fcc8 100644 --- a/distributedcloud-client/test-requirements.txt +++ b/distributedcloud-client/test-requirements.txt @@ -1,9 +1,10 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 -pylint==1.9.2;python_version<"3.0" # GPLv2 -pylint==2.3.1;python_version>="3.0" # GPLv2 +hacking>=1.1.0,<=2.0.0 # Apache-2.0 +isort<5;python_version>="3.0" +pylint<2.1.0;python_version<"3.0" # GPLv2 +pylint<2.3.0;python_version>="3.0" # GPLv2 python-openstackclient>=3.3.0 # Apache-2.0 sphinx>=1.5.1 # BSD fixtures>=3.0.0 # Apache-2.0/BSD diff --git a/distributedcloud-client/tox.ini b/distributedcloud-client/tox.ini index 1fcfb95..cde4b72 100644 --- a/distributedcloud-client/tox.ini +++ b/distributedcloud-client/tox.ini @@ -43,7 +43,7 @@ basepython = python3 commands = flake8 {posargs} [testenv:pylint] -basepython = python2.7 +basepython = python3 sitepackages = False deps = {[testenv]deps} commands = @@ -75,8 +75,10 @@ commands = oslo_debug_helper {posargs} [flake8] # E123, E125 skipped as they are invalid PEP-8. +# W504 line break after binary operator +# W605 invalid escape sequence show-source = True -ignore = E123,E125,H102 +ignore = E123,E125,W504,W605,H102 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*openstack/common*,*egg,build diff --git a/test-requirements.txt b/test-requirements.txt index f4f6d3b..18d4eaa 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,5 @@ PyYAML>=3.1.0 yamllint>=0.5.2 mock>=2.0 # BSD -bandit!=1.6.0,>=1.1.0,<2.0.0 +isort<5;python_version>="3.5" +bandit;python_version>="3.5"