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 <Al.Bailey@windriver.com>
Change-Id: If904bd184e5aaa458393f3154abb6f9c5f0fb967
This commit is contained in:
albailey 2021-12-14 09:37:23 -06:00
parent 0131cd569c
commit a72d8edca4
3 changed files with 24 additions and 5 deletions

4
bindep.txt Normal file
View File

@ -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]

View File

@ -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

12
tox.ini
View File

@ -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