commit 5ce2e066b18464b570523fa7138c26a3ef9ddfdd Author: Gregory Thiemonge Date: Tue Oct 6 13:54:14 2020 +0200 pin isort to 4.3.21, cap sphinx isort 4.3.21 is the last isort release that supports python2 sphinx on python2 requires <2.0.0 Change-Id: Ie09391eaad5f556a8ca78219fe268bc3801bbc36 diff --git a/.pylintrc b/.pylintrc index fa647fe..f973f08 100644 --- a/.pylintrc +++ b/.pylintrc @@ -54,7 +54,8 @@ disable= too-many-statements, multiple-statements, duplicate-except, - keyword-arg-before-vararg + keyword-arg-before-vararg, + useless-object-inheritance [BASIC] # Variable names can be 1 to 31 characters long, with lowercase and underscores diff --git a/doc/requirements.txt b/doc/requirements.txt index afd3597..29e810d 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,5 @@ -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD openstackdocstheme>=1.18.1 # Apache-2.0 # releasenotes reno>=2.5.0 # Apache-2.0 diff --git a/lower-constraints.txt b/lower-constraints.txt index 5ce8f74..a0bd58f 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -2,6 +2,7 @@ bandit==1.4.0 coverage==4.0 doc8==0.6.0 hacking==0.12.0 +isort==4.3.21 mock==2.0.0 oslo.i18n==3.15.3 oslo.log==3.36.0 diff --git a/octavia_lib/hacking/checks.py b/octavia_lib/hacking/checks.py index 506972a..8600da7 100644 --- a/octavia_lib/hacking/checks.py +++ b/octavia_lib/hacking/checks.py @@ -41,7 +41,7 @@ _log_translation_hint = re.compile( assert_trueinst_re = re.compile( r"(.)*assertTrue\(isinstance\((\w|\.|\'|\"|\[|\])+, " - "(\w|\.|\'|\"|\[|\])+\)\)") + r"(\w|\.|\'|\"|\[|\])+\)\)") assert_equal_in_end_with_true_or_false_re = re.compile( r"assertEqual\((\w|[][.'\"])+ in (\w|[][.'\", ])+, (True|False)\)") assert_equal_in_start_with_true_or_false_re = re.compile( @@ -92,14 +92,14 @@ def _check_namespace_imports(failure_code, namespace, new_ns, logical_line, logical_line.replace('%s.' % namespace, new_ns), logical_line) return (0, msg_o or msg) - elif _check_imports(namespace_imports_from_root, namespace, logical_line): + if _check_imports(namespace_imports_from_root, namespace, logical_line): msg = ("%s: '%s' must be used instead of '%s'.") % ( failure_code, logical_line.replace( 'from %s import ' % namespace, 'import %s' % new_ns), logical_line) return (0, msg_o or msg) - elif _check_imports(namespace_imports_dot, namespace, logical_line): + if _check_imports(namespace_imports_dot, namespace, logical_line): msg = ("%s: '%s' must be used instead of '%s'.") % ( failure_code, logical_line.replace('import', 'from').replace('.', ' import '), diff --git a/test-requirements.txt b/test-requirements.txt index f0ad8f1..20d3d94 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,10 @@ bandit>=1.1.0 # Apache-2.0 coverage>=4.0,!=4.4 # Apache-2.0 doc8>=0.6.0 # Apache-2.0 mock>=2.0.0 # BSD -pylint==1.9.2 # GPLv2 +pylint==1.9.2;python_version<'3.0' # GPLv2 +pylint>=1.9.2,<=2.5.3;python_version>='3.0' # GPLv2 +# Workaround for pylint dependency issue with py2.7 +isort==4.3.21;python_version=='2.7' # MIT python-subunit>=1.0.0 # Apache-2.0/BSD oslo.utils>=3.33.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0