
Running tox -e lint in an environment with python2.7 for example as the default python interpreter causes the following errors to be emitted: lint runtests: commands[0] | yapf -rd /opt/stack/ucp/promenade/promenade /opt/stack/ucp/promenade/tests lint runtests: commands[1] | flake8 /opt/stack/ucp/promenade/promenade /opt/stack/ucp/promenade/promenade/renderer.py:18:39: E999 SyntaxError: invalid syntax /opt/stack/ucp/promenade/promenade/config.py:17:19: E999 SyntaxError: invalid syntax /opt/stack/ucp/promenade/promenade/tar_bundler.py:17:20: E999 SyntaxError: invalid syntax /opt/stack/ucp/promenade/promenade/logging.py:76:12: E999 SyntaxError: invalid syntax /opt/stack/ucp/promenade/promenade/generator.py:11:33: E999 SyntaxError: invalid syntax /opt/stack/ucp/promenade/promenade/builder.py:15:33: E999 SyntaxError: invalid syntax /opt/stack/ucp/promenade/promenade/pki.py:59:43: E999 SyntaxError: invalid syntax /opt/stack/ucp/promenade/promenade/cli.py:13:16: E999 SyntaxError: invalid syntax This PS just adds basepython=python3.5 to the base [testenv] category from which jobs like tox -e lint inherit causing tox to use the python3.5 interpreter. Since Promenade only supports Python 3.5+ (since it isn't tested against anything else), this won't break anything. Change-Id: I549a02dbfa5f3b53bab26b87ad3042192e315530
55 lines
1.0 KiB
INI
55 lines
1.0 KiB
INI
[tox]
|
|
envlist = lint,unit,bandit,docs
|
|
|
|
[testenv]
|
|
basepython=python3.5
|
|
|
|
[testenv:unit]
|
|
setenv =
|
|
PYTHONWARNING=all
|
|
deps = -r{toxinidir}/requirements-frozen.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
pytest
|
|
|
|
[testenv:bandit]
|
|
deps = bandit==1.4.0
|
|
commands =
|
|
bandit -r promenade
|
|
|
|
[testenv:docs]
|
|
whitelist_externals = rm
|
|
deps =
|
|
sphinx>=1.6.2
|
|
sphinx_rtd_theme==0.2.4
|
|
commands =
|
|
rm -rf docs/build
|
|
python setup.py build_sphinx {posargs}
|
|
|
|
[testenv:fmt]
|
|
deps = yapf==0.20.0
|
|
commands =
|
|
yapf -ir {toxinidir}/promenade {toxinidir}/tests
|
|
|
|
[testenv:freeze]
|
|
deps = -r{toxinidir}/requirements-direct.txt
|
|
recreate = True
|
|
whitelist_externals = sh
|
|
commands=
|
|
sh -c "pip freeze | grep -v '^promenade' > {toxinidir}/requirements-frozen.txt"
|
|
|
|
[testenv:gate-lint]
|
|
deps =
|
|
jsonschema==2.6.0
|
|
whitelist_externals = sh
|
|
commands =
|
|
{toxinidir}/tools/lint_gate.sh
|
|
|
|
[testenv:lint]
|
|
deps =
|
|
yapf==0.20.0
|
|
flake8==3.5.0
|
|
commands =
|
|
yapf -rd {toxinidir}/promenade {toxinidir}/tests
|
|
flake8 {toxinidir}/promenade
|