From 3a6ef20dab62e9720a05ce95f1d986bdbd58f314 Mon Sep 17 00:00:00 2001 From: Tony Breeds Date: Thu, 18 Oct 2018 13:04:09 +1100 Subject: [PATCH] Leverage ignore_basepython_conflict to get the right python version Currently as we have basepython set in the testenv we always get the same python3 binary even when specifying a specific env (eg py37). This change uses ignore_basepython_conflict to tell tox when creating the py3X envoronments to use the major/minr from the env rather than basepython. Before: [tony@thor requirements]$ tox -re py37,py35,py36,py27 --notest [tony@thor requirements]$ for py in .tox/py*/bin/python ; do echo $py ; $py --version ; done .tox/py27/bin/python Python 3.6.6 .tox/py35/bin/python Python 3.5.6 .tox/py36/bin/python Python 3.6.6 .tox/py37/bin/python Python 3.6.6 After: [tony@thor requirements]$ tox -re py37,py35,py36,py27 --notest [tony@thor requirements]$ for py in .tox/py*/bin/python ; do echo $py ; $py --version ; done .tox/py27/bin/python Python 2.7.15 .tox/py35/bin/python Python 3.5.6 .tox/py36/bin/python Python 3.6.6 .tox/py37/bin/python Python 3.7.0 Change-Id: Ie16bfa0a96d41cc3d1712b0d3c7a6ce2378b5478 --- tox.ini | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tox.ini b/tox.ini index e11329b25a..df06d01711 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] -minversion = 1.6 +minversion = 3.1.0 skipsdist = True envlist = validate,py27,pep8,pip-install +ignore_basepython_conflict=true [testenv] basepython = python3 @@ -58,7 +59,6 @@ deps = hacking>=1.0.0 bashate>=0.5.1 whitelist_externals = bash -basepython = python3 commands = flake8 bash -c "find {toxinidir}/tools \ @@ -86,17 +86,7 @@ deps = . install_command = pip install {opts} {packages} commands = python {toxinidir}/tools/check-install.py -[testenv:py34] -basepython = python3.4 - -[testenv:py35] -basepython = python3.5 - -[testenv:py36] -basepython = python3.6 - [testenv:requirements-check] -basepython = python3 deps = -r{toxinidir}/requirements.txt commands = {toxinidir}/playbooks/files/project-requirements-change.py --local {posargs}