[tox] envlist = docs, docs-linkcheck, license, pre-commit, py36, py37, py38 minversion = 3.7 skip_missing_interpreters = true ignore_basepython_conflict = true [flake8] max-complexity = 22 max-line-length = 120 ignore = E203, W503, C901, E402, B011 [pep8] max-line-length = 120 [pytest] markers = datafiles addopts = -p no:warnings [testenv] basepython = python3 deps = -r{toxinidir}/requirements-test.txt commands = pytest usedevelop = true [testenv:docs] description = Build the documentation with sphinx basepython = python3 deps = -rrequirements-docs.txt extras = openstack commands = sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html [testenv:docs-linkcheck] description = Check the documentation links with sphinx basepython = python3 deps = -rrequirements-docs.txt extras = openstack commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck [testenv:latest-upstream] description = Latest upstream test. Used for what exactly? basepython = python3 deps = -r{toxinidir}/requirements-test.txt commands = pip install -U python-jenkins requests shade pytest [testenv:license] description = Check all files for license header basepython = python3 deps = lftools commands = lftools license check-dir lftools lftools license check-dir -r '.+' shell [testenv:pre-commit] description = Precommit checks for black, gitlint, etc. basepython = python3 allowlist_externals = /bin/sh deps = pre-commit passenv = HOME commands = pre-commit run --all-files --show-diff-on-failure /bin/sh -c 'if ! git config --get user.name > /dev/null; then \ git config --global --add user.name "CI"; \ touch .git/REMOVE_USERNAME; fi' /bin/sh -c 'if ! git config --get user.email > /dev/null; then \ git config --global --add user.email "ci@example.org"; \ touch .git/REMOVE_USEREMAIL; fi' /bin/sh -c "if [ -f .git/COMMIT_EDITMSG ]; then \ cp .git/COMMIT_EDITMSG .git/COMMIT_MSGTOX; else \ git log HEAD -n1 --pretty=%B > .git/COMMIT_MSGTOX; fi" pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_MSGTOX /bin/sh -c "rm -f .git/COMMIT_MSGTOX" /bin/sh -c "if [ -f .git/REMOVE_USERNAME ]; then \ git config --global --unset user.name; \ rm -f .git/REMOVE_USERNAME; fi" /bin/sh -c "if [ -f .git/REMOVE_USEREMAIL ]; then \ git config --global --unset user.email; \ rm -f .git/REMOVE_USEREMAIL; fi" [testenv:reno] description = OpenStack Reno checks basepython = python3 deps = reno commands = reno {posargs:--help}