[ussuri][goal] Updates for python 2.7 drop

OpenStack is dropping the py2.7 support in ussuri cycle.

Only update required is in tox to define common baspython as py3 os that
all tox env including [testenv:functional] will use py3 instead of py2.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: Ic9587fda5e2ba04ef151c32706b8da04a04096d4
This commit is contained in:
Ghanshyam Mann 2020-03-01 19:17:27 -06:00
parent b98892390d
commit c16b84b127

13
tox.ini
View File

@ -1,9 +1,11 @@
[tox] [tox]
minversion = 2.0 minversion = 3.1
skipsdist = True skipsdist = True
envlist = docs,linters,functional envlist = docs,linters,functional
ignore_basepython_conflict = True
[testenv] [testenv]
basepython = python3
usedevelop = True usedevelop = True
install_command = install_command =
pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
@ -30,7 +32,6 @@ setenv =
WORKING_DIR={toxinidir} WORKING_DIR={toxinidir}
[testenv:docs] [testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = commands =
bash -c "rm -rf doc/build" bash -c "rm -rf doc/build"
@ -38,7 +39,6 @@ commands =
sphinx-build --keep-going -b html doc/source doc/build/html sphinx-build --keep-going -b html doc/source doc/build/html
[testenv:pdf-docs] [testenv:pdf-docs]
basepython = python3
deps = {[testenv:docs]deps} deps = {[testenv:docs]deps}
whitelist_externals = whitelist_externals =
make make
@ -51,19 +51,16 @@ commands =
extensions = .rst extensions = .rst
[testenv:releasenotes] [testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt deps = -r{toxinidir}/doc/requirements.txt
commands = commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
# environment used by the -infra templated docs job # environment used by the -infra templated docs job
[testenv:venv] [testenv:venv]
basepython = python3
commands = commands =
{posargs} {posargs}
[testenv:pep8] [testenv:pep8]
basepython = python3
commands = commands =
bash -c "{toxinidir}/tests/common/test-pep8.sh" bash -c "{toxinidir}/tests/common/test-pep8.sh"
@ -75,17 +72,14 @@ commands =
ignore=F403,H303 ignore=F403,H303
[testenv:bashate] [testenv:bashate]
basepython = python3
commands = commands =
bash -c "{toxinidir}/tests/common/test-bashate.sh" bash -c "{toxinidir}/tests/common/test-bashate.sh"
[testenv:ansible-syntax] [testenv:ansible-syntax]
basepython = python3
commands = commands =
bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh" bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh"
[testenv:ansible-lint] [testenv:ansible-lint]
basepython = python3
commands = commands =
bash -c "{toxinidir}/tests/common/test-ansible-lint.sh" bash -c "{toxinidir}/tests/common/test-ansible-lint.sh"
@ -94,7 +88,6 @@ commands =
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
[testenv:linters] [testenv:linters]
basepython = python3
commands = commands =
bash -c "{toxinidir}/tests/common/test-ansible-env-prep.sh" bash -c "{toxinidir}/tests/common/test-ansible-env-prep.sh"
{[testenv:pep8]commands} {[testenv:pep8]commands}