[tox] minversion = 1.6 envlist = py3,pep8 # Automatic envs (pyXX) will only use the python version appropriate to that # env and ignore basepython inherited from [testenv] if we set # ignore_basepython_conflict. ignore_basepython_conflict = True [testenv] basepython = python3 # Note the hash seed is set to 0 until venus can be tested with a # random hash seed successfully. setenv = VIRTUAL_ENV={envdir} OS_TEST_PATH=venus/tests/unit usedevelop = True allowlist_externals = bash find rm env make install_command = pip install {opts} {packages} deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = rm -f .testrepository/times.dbm stestr run --slowest {posargs} [testenv:releasenotes] deps = -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:pep8] commands = flake8 {posargs} . venus/common # Check that .po and .pot files are valid: doc8 --ignore D001 doc/source/ CONTRIBUTING.rst HACKING.rst README.rst [testenv:fast8] description = Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8' envdir = {toxworkdir}/shared commands = bash tools/flake8wrap.sh -HEAD [testenv:venv] commands = {posargs} [testenv:cover] setenv = PYTHON=coverage run --source cyborg --parallel-mode commands = coverage erase stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml coverage report [doc8] ignore-path = .venv,.git,.tox,*venus/locale*,*lib/python*,*venus.egg*,api-ref/build,doc/build,doc/source/contributor/api [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/build/html sphinx-build -W -b html doc/source doc/build/html [testenv:api-ref] description = Generate the API ref. Called from CI scripts to test and publish to docs.openstack.org. # This environment is called from CI scripts to test and publish # the API Ref to docs.openstack.org. envdir = {toxworkdir}/docs deps = {[testenv:docs]deps} commands = rm -rf api-ref/build sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html allowlist_externals = rm [flake8] # Following checks are ignored on purpose. # # E251 unexpected spaces around keyword / parameter equals # reason: no improvement in readability # # Due to the upgrade to hacking 0.9.2 the following checking are # ignored on purpose for the moment and should be re-enabled. # # H405 # Due to the upgrade to hacking 0.10.0 the following checking are # ignored on purpose for the moment and should be cleaned up and re-enabled. # # H105 Don't use author tags # filename = *.py,app.wsgi show-source = True ignore = E123,E125,H405,W503,W504,E251,H105,W605 builtins = _ enable-extensions = H106,H203,H904 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*sqlalchemy/alembic/versions/*,demo/,releasenotes [flake8:local-plugins] extension = M302 = checks:assert_equal_not_none M310 = checks:use_timeutils_utcnow M316 = checks:assert_true_isinstance M322 = checks:no_mutable_default_args M336 = checks:dict_constructor_with_list_copy M338 = checks:assert_equal_in M339 = checks:no_xrange M340 = checks:check_explicit_underscore_import M352 = checks:no_log_warn N366 = checks:import_stock_mock paths = ./venus/hacking [hacking] local-check-factory = venus.hacking.checks.factory import_exceptions = venus.i18n