From de721f5c7c105663c8119a380686736ef18b5a75 Mon Sep 17 00:00:00 2001 From: Scott Little Date: Mon, 6 Feb 2023 13:34:54 -0500 Subject: [PATCH] Update .gitreview for r/stx.8.0 Many additional changes were required - mysqlclient is required for python3 - bindep settings to install the dpkg entries for mysql - pin the pylint to a lesser value (for now) - suppress many new pylint errors being reported (for now) - set the nodeset of pylint to be debian-bullseye Signed-off-by: Scott Little Change-Id: I4a1ee5844fbbec0acc4b8a55848766a0d88b0c57 --- .gitreview | 1 + .zuul.yaml | 4 ++-- bindep.txt | 7 +++++++ pylint.rc | 17 +++++++++++++++-- tox.ini | 18 +++++++++++++++--- 5 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 bindep.txt diff --git a/.gitreview b/.gitreview index 313e8096..7a42d030 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=review.opendev.org port=29418 project=starlingx/ha.git +defaultbranch=r/stx.8.0 diff --git a/.zuul.yaml b/.zuul.yaml index eda83670..e4e89bb8 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -61,8 +61,8 @@ name: ha-tox-pylint parent: tox description: | - Run pylint test for ha in python2.7 - nodeset: ubuntu-bionic + Run pylint test for ha in python3 + nodeset: debian-bullseye vars: tox_envlist: pylint - job: diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 00000000..e4818113 --- /dev/null +++ b/bindep.txt @@ -0,0 +1,7 @@ +# This is a cross-platform list tracking distribution packages needed for install and tests; +# see https://docs.openstack.org/infra/bindep/ for additional information. +build-essential [platform:dpkg] +python3-dev [platform:dpkg] +# default-libmysqlclient-dev is debian specific +default-libmysqlclient-dev [platform:debian] + diff --git a/pylint.rc b/pylint.rc index 65004e13..95e29e7b 100755 --- a/pylint.rc +++ b/pylint.rc @@ -131,7 +131,6 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652, # W1201 logging-not-lazy # W1401 anomalous-backslash-in-string # W1618: no-absolute-import -# # The following are errors which should be fixed # # method-hidden (E0202) @@ -146,11 +145,25 @@ enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652, # not-callable (E1102) # too-many-function-args (E1121) # unsubscriptable-object (E1136) +# +# These are temporarily added to get pylint in python3 working +# W0143 comparison-with-callable +# W0237 arguments-renamed +# W0707 raise-missing-from +# W1505 deprecated-method +# W1509 subprocess-popen-preexec-fn +# E0605 invalid-all-format +# E1123 unexpected-keyword-arg +# E1124 redundant-keyword-arg +# E1135 unsupported-membership-test +# disable=C, R, W0102, W0107, W0110, W0120, W0201, W0212, W0221, W0223, W0231, W0235, W0402, W0403, W0511, W0603, W0611, W0612, W0613, W0621, W0622, W0702, W0703, W1113, W1201, W1401, W1618, - E0202, E0203, E0602, E0604, E0611, E0702, E0711, E1003, E1101, E1102, E1121, E1136 + E0202, E0203, E0602, E0604, E0611, E0702, E0711, E1003, E1101, E1102, E1121, E1136, + W0143, W0237, W0707, W1505, W1509, E0605, E1123, E1124, E1135 + diff --git a/tox.ini b/tox.ini index e9d161f0..5de80765 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,10 @@ commands = -print0 | xargs -0 yamllint" [testenv:pylint] -basepython = python2.7 +basepython = python3 +install_command = pip install \ + -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \ + {opts} {packages} deps = {[testenv]deps} eventlet httplib2 @@ -44,7 +47,7 @@ deps = {[testenv]deps} jsonpatch keystonemiddleware kombu - MySQL-python + mysqlclient oslo.config pecan prettytable @@ -52,7 +55,7 @@ deps = {[testenv]deps} sqlalchemy sqlalchemy-migrate wsme - pylint + pylint<2.10 commands = pylint --rcfile=./pylint.rc --extension-pkg-whitelist=greenlet \ ./service-mgmt-api/sm-api/sm_api/ \ @@ -156,3 +159,12 @@ basepython = python3 description = Bandit code scan for *.py files under config folder deps = -r{toxinidir}/test-requirements.txt commands = bandit --ini tox.ini -r {toxinidir}/ -x '**/.tox/**',**/.eggs/** -lll + +[testenv:bindep] +# Do not install any requirements. We want this to be fast and work even if +# system dependencies are missing, since it's used to tell you what system +# dependencies are missing! This also means that bindep must be installed +# separately, outside of the requirements files. +skip_install = True +deps = bindep +commands = bindep test