apmec/tox.ini
huang.zhiping 18197c5fed fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I43b21411d01290ddea7ca5fe11d70e970bf65bb3
2018-06-10 16:03:14 +00:00

121 lines
3.4 KiB
INI

[tox]
envlist = py35,py27,pep8,docs
minversion = 1.6
skipsdist = True
[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
usedevelop = True
whitelist_externals = rm
install_command =
pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
rm -f .testrepository/times.dbm
[testenv:functional]
basepython = python3
setenv = OS_TEST_PATH=./apmec/tests/functional
deps =
{[testenv]deps}
-e git://github.com/pineunity/python-apmecclient-1.git#egg=python-apmecclient
-e git://github.com/pineunity/mec-tosca-parser.git#egg=tosca-parser
-e git://github.com/pineunity/mec-heat-translator.git#egg=heat-translator
[testenv:dsvm-functional]
basepython = python2.7
setenv = {[testenv]setenv}
{[testenv:functional]setenv}
deps =
{[testenv:functional]deps}
-e git://github.com/pineunity/python-apmecclient-1.git#egg=python-apmecclient
-e git://github.com/pineunity/mec-tosca-parser.git#egg=tosca-parser
-e git://github.com/pineunity/mec-heat-translator.git#egg=heat-translator
[tox:jenkins]
sitepackages = True
[testenv:debug]
basepython = python3
commands = oslo_debug_helper {posargs}
[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper {posargs}
[testenv:debug-py35]
basepython = python3.5
commands = oslo_debug_helper {posargs}
[testenv:pep8]
basepython = python2.7
commands =
flake8
doc8 -e .rst doc/source/ CONTRIBUTING.rst HACKING.rst README.rst TESTING.rst
apmec-db-manage check_migration
bash -c "find apmec -type f -regex '.*\.pot?' -print0|xargs -0 --no-run-if-empty -n 1 msgfmt --check-format -o /dev/null"
whitelist_externals = bash
[testenv:i18n]
basepython = python3
commands = python ./tools/check_i18n.py ./apmec ./tools/i18n_cfg.py
[testenv:docs]
basepython = python2.7
commands =
doc8 -e .rst doc/source/ CONTRIBUTING.rst HACKING.rst README.rst TESTING.rst
python setup.py build_sphinx
[testenv:api-ref]
basepython = python3
# This environment is called from CI scripts to test and publish
# the API Ref to developer.openstack.org.
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
whitelist_externals = rm
[testenv:releasenotes]
basepython = python3
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:cover]
basepython = python3
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
commands =
coverage erase
python setup.py testr --coverage --testr-args='{posargs}'
coverage report
[testenv:venv]
basepython = python3
commands = {posargs}
[flake8]
# E128 continuation line under-indented for visual indent
# N320 log messages does not translate
ignore = E128,N320
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,.ropeproject
[hacking]
import_exceptions = apmec._i18n
local-check-factory = apmec.hacking.checks.factory
[testenv:config-gen]
basepython = python3
commands =
oslo-config-generator --config-file=etc/config-generator.conf
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt