Merge "Python 2.7 environment, mimicking the one used by RDO"

This commit is contained in:
Zuul 2021-06-04 07:10:36 +00:00 committed by Gerrit Code Review
commit 3a087532e6
1 changed files with 23 additions and 0 deletions

23
tox.ini
View File

@ -42,6 +42,29 @@ deps =
-r {toxinidir}/doc/requirements.txt -r {toxinidir}/doc/requirements.txt
whitelist_externals = bash whitelist_externals = bash
[testenv:py27]
envtmpdir={envdir}/tmp
skip_install = true
commands_pre =
cp -r {toxinidir}/validations_common {envtmpdir}/validations_common
touch {envtmpdir}/validations_common/library/__init__.py
find {envtmpdir}/validations_common/tests/ -type f -exec sed -i -e 's/from unittest import mock/import mock/g' \{\} ;
find {envtmpdir}/validations_common/tests/ -type f -exec sed -i -e 's/from unittest.mock/from mock/g' \{\} ;
find {envtmpdir} -type f -name 'setup.cfg' -exec sed -i -e 's/python-requires = >=3.6/python-requires = >=2.7/g' \{\} ;
commands =
python2.7 -m unittest discover -s {envtmpdir}/validations_common/tests
deps =
-c {env:TOX_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/train/upper-constraints.txt}
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
ansible>=2
whitelist_externals =
bash
cp
find
sed
touch
[testenv:bindep] [testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if # 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 # system dependencies are missing, since it's used to tell you what system