From a72d8edca453e86e001d82551d7877c73f1a7902 Mon Sep 17 00:00:00 2001 From: albailey Date: Tue, 14 Dec 2021 09:37:23 -0600 Subject: [PATCH] Adding rpm-python to bindep to fix pylint Tox pylint target fails when it cannot 'import rpm'. There is no pypi package that provides that, since the centos rpm-python is meant to be installed on the host. Adding the bindep entry for rpm-python, which the zuul job will use to prepare the zuul worker host to properly provide the necessary rpm. Story: 2008943 Task: 44183 Signed-off-by: albailey Change-Id: If904bd184e5aaa458393f3154abb6f9c5f0fb967 --- bindep.txt | 4 ++++ test-requirements.txt | 13 +++++++++---- tox.ini | 12 +++++++++++- 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 bindep.txt diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 00000000..ddd9c490 --- /dev/null +++ b/bindep.txt @@ -0,0 +1,4 @@ +# This is a cross-platform list tracking distribution packages needed for install and tests; +# see https://docs.openstack.org/infra/bindep/ for additional information. + +rpm-python [platform:rpm] diff --git a/test-requirements.txt b/test-requirements.txt index 39d9d1f7..65192920 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,8 +1,13 @@ -hacking>=2.0<2.1 - -pycodestyle>=2.0.0 # MIT License +# The order of packages is significant, because pip processes them in the order +# of appearance. +# always put 'hacking' first. it pulls in flake8, etc.. +hacking>=1.1.0,<=2.0.0 # Apache-2.0 +astroid<2.0;python_version<"3.0" # GPLv2 +astroid<= 2.2.5;python_version>="3.0" # GPLv2 mock>=2.0.0 # BSD bandit>=1.1.0,<1.6.3 # Apache-2.0 bashate >= 0.2 +pylint<2.1.0;python_version<"3.0" # GPLv2 +pylint<2.4.0;python_version>="3.0" # GPLv2 PyYAML >= 3.1.0 -yamllint >= 0.5.2 +yamllint<1.26.1;python_version>="3.0" # GPLv2 diff --git a/tox.ini b/tox.ini index 06d9b84f..4c7a742c 100644 --- a/tox.ini +++ b/tox.ini @@ -158,8 +158,9 @@ deps = -r{toxinidir}/test-requirements.txt commands = bandit --ini tox.ini -r {toxinidir}/ -x '**/.tox/**,**/.eggs/**' -lll [testenv:pylint] +# must set sitepackages to true in order to 'import rpm' +sitepackages=true basepython = python2.7 -deps = {[testenv]deps} whitelist_externals = cp find tox @@ -212,3 +213,12 @@ commands = rm -rf api-ref/build sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html whitelist_externals = rm + +[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