tox.ini 1.91 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
[tox]
minversion = 2.3.1
skipsdist = True
envlist = py35,py27,pep8

[testenv]
usedevelop = True
install_command = pip install {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps =
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
commands =
14
  find tests -type f -name "*.pyc" -delete
15
16
17
18
19
20
21
22
23
24
25
26
27
  stestr run {posargs}
whitelist_externals =
  bash
  find
passenv = PBR_VERSION

[testenv:pep8]
basepython = python3
deps =
     {[testenv]deps}
commands =
  flake8
  # Run security linter
28
  bandit -r tests -x tests
29
30
31

[testenv:bandit]
basepython = python3
32
commands = bandit -r tests -x tests
33
34
35
36
37
38
39
40

[testenv:venv]
basepython = python3
commands = {posargs}

[testenv:cover]
basepython = python3
setenv =
41
    PYTHON=coverage run --source tests --parallel-mode
42
43
44
45
46
47
48
49
50
51
52
commands =
    stestr run {posargs}
    coverage combine
    coverage html -d cover
    coverage xml -o cover/coverage.xml
    coverage report

[flake8]
filename= *.py
show-source = true
enable-extensions = H203,H904
Matteo Paltenghi's avatar
Matteo Paltenghi committed
53
54
55
per-file-ignores =
    # continuation line under-indented for visual indent
    ./tests/spark_etl/*.py: E127,E128,E501,E704,E731,E741
56
57
58
59
60
61

# D100: Missing docstring in public module
# D101: Missing docstring in public class
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D104: Missing docstring in public package
Matteo Paltenghi's avatar
Matteo Paltenghi committed
62
# D107: Missing docstring in __init__
Matteo Paltenghi's avatar
Matteo Paltenghi committed
63
# H105  Don't use author tags
64
65
# D203: 1 blank line required before class docstring (deprecated in pep257)
# H202: assertRaises Exception too broad
Matteo Paltenghi's avatar
Matteo Paltenghi committed
66
# D401: First line should be in imperative mood
67
# H306  imports not in alphabetical order  (follow this rule instead https://www.python.org/dev/peps/pep-0008/#imports)
Matteo Paltenghi's avatar
Matteo Paltenghi committed
68
69
70
# W504: line break after binary operator
# W503: line break before binary operator
ignore = D100,D101,D102,D103,D104,D107,H105,D203,H202,D401,H306,W504,W503
71
72
73

exclude=.venv,.git,.tox,build,dist,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot
max-complexity=24