Fix tox to clean python cache
[doctor.git] / tox.ini
1 [tox]
2 minversion = 2.3.1
3 envlist = py34, pep8,docs,docs-linkcheck
4 skipsdist = True
5
6 [testenv]
7 usedevelop = True
8 install_command = pip install \
9     -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike \
10     {opts} {packages}
11 setenv = VIRTUAL_ENV={envdir}
12 deps = -r{toxinidir}/requirements.txt
13 passenv =
14     OS_AUTH_URL
15     OS_USERNAME
16     OS_PASSWORD
17     OS_USER_DOMAIN_NAME
18     OS_USER_DOMAIN_ID
19     OS_PROJECT_NAME
20     OS_TENANT_NAME
21     OS_PROJECT_DOMAIN_NAME
22     OS_PROJECT_DOMAIN_ID
23     OS_REGION_NAME
24     OS_CACERT
25     IMAGE_NAME
26     VM_COUNT
27     PROFILER_TYPE
28     CI_DEBUG
29     INSTALLER_TYPE
30     INSTALLER_IP
31     INSPECTOR_TYPE
32     ADMIN_TOOL_TYPE
33     TEST_CASE
34     SSH_KEY
35 changedir = {toxinidir}/doctor_tests
36 commands = doctor-test
37            /bin/find {toxinidir} -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
38
39 [testenv:pep8]
40 changedir = {toxinidir}
41 commands = flake8
42
43 [flake8]
44 # E123, E125 skipped as they are invalid PEP-8.
45 # H106: Don’t put vim configuration in source files
46 # H203: Use assertIs(Not)None to check for None
47
48 show-source = True
49 ignore = E123,E125
50 enable-extensions=H106,H203
51 builtins = _
52 filename = *.py,app.wsgi
53 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tests
54
55 [testenv:docs]
56 changedir = {toxinidir}
57 deps = -rdocs/requirements.txt
58 commands =
59     sphinx-build -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
60     echo "Generated docs available in {toxinidir}/docs/_build/html"
61 whitelist_externals = echo
62
63 [testenv:docs-linkcheck]
64 changedir = {toxinidir}
65 deps = -rdocs/requirements.txt
66 commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck