3a6ef20dab
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
102 lines
3.1 KiB
INI
102 lines
3.1 KiB
INI
[tox]
|
|
minversion = 3.1.0
|
|
skipsdist = True
|
|
envlist = validate,py27,pep8,pip-install
|
|
ignore_basepython_conflict=true
|
|
|
|
[testenv]
|
|
basepython = python3
|
|
usedevelop = True
|
|
install_command = pip install -U {opts} {packages}
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
stestr run {posargs}
|
|
|
|
[testenv:py27-check-uc]
|
|
basepython = python2.7
|
|
install_command = pip install -U {opts} -c {toxinidir}/upper-constraints.txt {packages}
|
|
deps = -r{toxinidir}/upper-constraints.txt
|
|
commands = check-conflicts {toxinidir}/upper-constraints.txt {toxinidir}/upper-constraints-xfails.txt
|
|
|
|
[testenv:py35-check-uc]
|
|
basepython = python3.5
|
|
install_command = pip install -U {opts} -c {toxinidir}/upper-constraints.txt {packages}
|
|
deps = -r{toxinidir}/upper-constraints.txt
|
|
commands = check-conflicts {toxinidir}/upper-constraints.txt {toxinidir}/upper-constraints-xfails.txt
|
|
|
|
[testenv:py36-check-uc]
|
|
basepython = python3.6
|
|
install_command = pip install -U {opts} -c {toxinidir}/upper-constraints.txt {packages}
|
|
deps = -r{toxinidir}/upper-constraints.txt
|
|
commands = check-conflicts {toxinidir}/upper-constraints.txt {toxinidir}/upper-constraints-xfails.txt
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:update]
|
|
commands = update-requirements {posargs}
|
|
|
|
[testenv:generate]
|
|
commands = generate-constraints {posargs}
|
|
|
|
[testenv:validate]
|
|
commands =
|
|
validate-constraints {toxinidir}/global-requirements.txt {toxinidir}/upper-constraints.txt {toxinidir}/blacklist.txt
|
|
|
|
[testenv:validate-projects]
|
|
commands = validate-projects {toxinidir}/projects.txt
|
|
|
|
# TODO remove once zuul reconfigured to run linters on gate
|
|
[testenv:pep8]
|
|
deps = {[testenv:linters]deps}
|
|
whitelist_externals = {[testenv:linters]whitelist_externals}
|
|
commands = {[testenv:linters]commands}
|
|
|
|
[testenv:linters]
|
|
deps =
|
|
hacking>=1.0.0
|
|
bashate>=0.5.1
|
|
whitelist_externals = bash
|
|
commands =
|
|
flake8
|
|
bash -c "find {toxinidir}/tools \
|
|
-type f \
|
|
-name \*.sh \
|
|
-print0 | xargs -0 bashate -v -iE006,E010"
|
|
|
|
[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, and develop mode disabled
|
|
# explicitly to avoid unnecessarily installing the checked-out repo too (this
|
|
# further relies on "tox.skipsdist = True" above).
|
|
deps = bindep
|
|
commands = bindep test
|
|
usedevelop = False
|
|
|
|
[testenv:docs]
|
|
commands = python setup.py build_sphinx
|
|
|
|
[testenv:pip-install]
|
|
recreate = True
|
|
deps = .
|
|
install_command = pip install {opts} {packages}
|
|
commands = python {toxinidir}/tools/check-install.py
|
|
|
|
[testenv:requirements-check]
|
|
deps = -r{toxinidir}/requirements.txt
|
|
commands =
|
|
{toxinidir}/playbooks/files/project-requirements-change.py --local {posargs}
|
|
|
|
[testenv:babel]
|
|
# Use the local upper-constraints.txt file
|
|
deps = Babel
|
|
install_command = pip install -c upper-constraints.txt {opts} {packages}
|
|
commands = {toxinidir}/tools/babel-test.sh
|
|
|
|
[flake8]
|
|
exclude = .venv,.git,.tox,dist,doc,*egg,build
|