From a38becca994f956502f22f282b6aa30fb07b9058 Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Wed, 27 May 2020 15:04:24 +0200 Subject: [PATCH] Fix py27 tox siblings: python2.7 ConfigParser has no __getitem__ Constrain soupsieve to <2 for python2.7 Add python2-dev to bindep for subprocess32 Change-Id: If9d6a0ae1a62a94dcec11f6bf637ffee7f0f4fc9 --- bindep.txt | 5 +++++ roles/tox/library/tox_install_sibling_packages.py | 5 ++--- test-constraints.txt | 1 + tox.ini | 3 +++ 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 test-constraints.txt diff --git a/bindep.txt b/bindep.txt index d4b7a27f3..98664f56d 100644 --- a/bindep.txt +++ b/bindep.txt @@ -3,3 +3,8 @@ gcc [test] # Required for openstacksdk python3-devel [test platform:rpm] python3-dev [test platform:dpkg platform:apk] + +# Required for subprocess32 +python2-devel [test platform:fedora] +python-devel [test platform:rpm !platform:fedora !platform:centos-8] +python-dev [test platform:dpkg platform:apk] diff --git a/roles/tox/library/tox_install_sibling_packages.py b/roles/tox/library/tox_install_sibling_packages.py index fb6d7b95d..50f7b25fc 100644 --- a/roles/tox/library/tox_install_sibling_packages.py +++ b/roles/tox/library/tox_install_sibling_packages.py @@ -318,9 +318,8 @@ def main(): changed = False for testenv in envlist: - testenv_config = tox_config["testenv:{}".format(testenv)] - envdir = testenv_config['envdir'] - envlogdir = testenv_config['envlogdir'] + envdir = tox_config.get("testenv:{}".format(testenv), 'envdir') + envlogdir = tox_config.get("testenv:{}".format(testenv), 'envlogdir') try: # Write a log file into the .tox dir so that it'll get picked up # Name it with testenv as a prefix so that fetch-tox-output diff --git a/test-constraints.txt b/test-constraints.txt new file mode 100644 index 000000000..815716c06 --- /dev/null +++ b/test-constraints.txt @@ -0,0 +1 @@ +soupsieve < 2.0; python_version < '3.5' diff --git a/tox.ini b/tox.ini index d7f7f793d..c88cd6f74 100644 --- a/tox.ini +++ b/tox.ini @@ -12,6 +12,9 @@ commands = stestr run {posargs} stestr slowest [testenv:py27] +deps = + -r{toxinidir}/test-requirements.txt + -c{toxinidir}/test-constraints.txt basepython = python2.7 [testenv:bindep]