161326fe06
Readthedocs failed to render Drydock exceptions with error: > WARNING: autodoc: failed to import exception xxx from module > 'drydock_provisioner'; the following exception was raised: No module > named 'drydock_provisioner' Trying to add Drydock requirements to the installed requirements list, so that Readthedocs has all modules, including those needed for the Drydock itself. Unify docs building by utilizing Zuul docs-on-readthedocs template job. Cosmetic readability changes: 1. combined all Makefile .PHONY targets into one 2. merged multiple LABEL instructions in Dockerfile into one Change-Id: I6a9b47cffc66d739968fa886c51e25b1e09ef124
106 lines
2.8 KiB
INI
106 lines
2.8 KiB
INI
[tox]
|
|
envlist = py35,pep8,bandit
|
|
setupdir=python/
|
|
|
|
[testenv]
|
|
setenv = YAMLDIR = {toxinidir}/python/tests/yaml_samples/
|
|
basepython=python3
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
|
deps=
|
|
-rpython/requirements-lock.txt
|
|
-rpython/requirements-test.txt
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:freeze]
|
|
basepython=python3
|
|
recreate = True
|
|
whitelist_externals=
|
|
rm
|
|
sh
|
|
deps=
|
|
-rpython/requirements-direct.txt
|
|
commands=
|
|
rm python/requirements-lock.txt
|
|
sh -c "pip freeze --all | grep -vE 'drydock-provisioner|pyinotify|pkg-resources==0.0.0' > python/requirements-lock.txt"
|
|
|
|
[testenv:yapf]
|
|
basepython=python3
|
|
whitelist_externals=find
|
|
commands=
|
|
yapf -i -r --style=pep8 {toxinidir}/python/setup.py
|
|
yapf -i -r --style=pep8 {toxinidir}/alembic
|
|
yapf -i -r --style=pep8 {toxinidir}/python/drydock_provisioner
|
|
yapf -i -r --style=pep8 {toxinidir}/python/tests
|
|
find {toxinidir}/python/drydock_provisioner -name '__init__.py' -exec yapf -i --style=pep8 \{\} ;
|
|
|
|
[testenv:py35]
|
|
basepython=python3
|
|
usedevelop=True
|
|
setenv=
|
|
PYTHONWARNING=all
|
|
YAMLDIR={toxinidir}/python/tests/yaml_samples/
|
|
commands=
|
|
py.test \
|
|
--cov=drydock_provisioner \
|
|
{toxinidir}/python/tests/unit/{posargs}
|
|
|
|
[testenv:integration]
|
|
basepython=python3.5
|
|
passenv=DOCKER_REGISTRY IMAGE_NAME IMAGE_PREFIX IMAGE_TAG
|
|
setenv=
|
|
PYTHONWARNING=all
|
|
YAMLDIR={toxinidir}/python/tests/yaml_samples/
|
|
commands=
|
|
{toxinidir}/python/tests/postgres/start_postgres.sh
|
|
py.test \
|
|
{toxinidir}/python/tests/integration/postgres/{posargs}
|
|
|
|
[testenv:cover]
|
|
basepython=python3
|
|
usedevelop=True
|
|
passenv=DOCKER_REGISTRY IMAGE_NAME IMAGE_PREFIX IMAGE_TAG
|
|
setenv=
|
|
YAMLDIR={toxinidir}/python/tests/yaml_samples/
|
|
commands=
|
|
{toxinidir}/python/tests/postgres/start_postgres.sh
|
|
py.test --cov=drydock_provisioner \
|
|
{toxinidir}/python/tests/unit/ {toxinidir}/python/tests/integration/postgres
|
|
|
|
[testenv:genconfig]
|
|
basepython=python3
|
|
whitelist_externals=tee
|
|
sh
|
|
commands = sh -c 'oslo-config-generator --config-file=etc/drydock/drydock-config-generator.conf | tee etc/drydock/drydock.conf.sample doc/source/_static/drydock.conf.sample'
|
|
|
|
[testenv:genpolicy]
|
|
basepython=python3
|
|
whitelist_externals=tee
|
|
sh
|
|
commands = sh -c 'oslopolicy-sample-generator --config-file etc/drydock/drydock-policy-generator.conf | tee etc/drydock/policy.yaml.sample doc/source/_static/policy.yaml.sample'
|
|
|
|
[testenv:pep8]
|
|
basepython=python3
|
|
commands = flake8 \
|
|
{posargs}
|
|
|
|
[testenv:bandit]
|
|
basepython=python3
|
|
commands = bandit -r drydock_provisioner -n 5
|
|
|
|
[flake8]
|
|
ignore=E302,H306,H304,W503,E251,E126
|
|
exclude= venv,.venv,.git,.idea,.tox,*.egg-info,*.eggs,bin,dist,./build/,alembic/
|
|
max-line-length=119
|
|
|
|
[testenv:docs]
|
|
basepython=python3
|
|
deps=
|
|
-rdoc/requirements-doc.txt
|
|
whitelist_externals=rm
|
|
recreate=true
|
|
commands =
|
|
rm -rf doc/build
|
|
sphinx-build -b html doc/source doc/build/html
|