Fix bug 1479 to check conflicts on deleting vnpkg
[osm/NBI.git] / tox.ini
1 # Copyright 2018 Telefonica S.A.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12 # implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16
17 [tox]
18 envlist = black, cover, flake8, pylint, safety
19
20 [tox:jenkins]
21 toxworkdir = /tmp/.tox
22
23 [testenv]
24 usedevelop = True
25 basepython = python3
26 setenv = VIRTUAL_ENV={envdir}
27 PYTHONDONTWRITEBYTECODE = 1
28 deps = -r{toxinidir}/requirements.txt
29
30 #######################################################################################
31 [testenv:black]
32 deps = black
33 skip_install = true
34 commands =
35 - black --check --diff osm_nbi/
36
37
38 #######################################################################################
39 [testenv:cover]
40 deps = {[testenv]deps}
41 -r{toxinidir}/requirements-dev.txt
42 -r{toxinidir}/requirements-test.txt
43 commands =
44 sh -c 'rm -f nosetests.xml'
45 coverage erase
46 nose2 -C --coverage osm_nbi -s osm_nbi/tests
47 coverage report --omit='*tests*'
48 coverage html -d ./cover --omit='*tests*'
49 coverage xml -o coverage.xml --omit=*tests*
50 whitelist_externals = sh
51
52
53 #######################################################################################
54 [testenv:flake8]
55 deps = flake8
56 commands =
57 - flake8 osm_nbi/ setup.py
58
59
60 #######################################################################################
61 [testenv:pylint]
62 deps = {[testenv]deps}
63 -r{toxinidir}/requirements-dev.txt
64 -r{toxinidir}/requirements-test.txt
65 pylint
66 commands =
67 - pylint -E osm_nbi
68
69
70 #######################################################################################
71 [testenv:safety]
72 setenv =
73 LC_ALL=C.UTF-8
74 LANG=C.UTF-8
75 deps = {[testenv]deps}
76 safety
77 commands =
78 - safety check --full-report
79
80
81 #######################################################################################
82 [testenv:pip-compile]
83 deps = pip-tools==5.5.0
84 commands =
85 - sh -c 'for file in requirements*.in ; do pip-compile -rU --no-header $file ;\
86 out=`echo $file | sed "s/.in/.txt/"` ; \
87 head -16 tox.ini >> $out ;\
88 done'
89 whitelist_externals = sh
90
91
92 #######################################################################################
93 [testenv:dist]
94 deps = {[testenv]deps}
95 -r{toxinidir}/requirements-dist.txt
96
97 # In the commands, we copy the requirements.txt to be presented as a source file (.py)
98 # so it gets included in the .deb package for others to consume
99 commands =
100 sh -c 'cp requirements.txt osm_nbi/requirements.txt'
101 python3 setup.py --command-packages=stdeb.command sdist_dsc
102 sh -c 'cd deb_dist/osm-nbi*/ && dpkg-buildpackage -rfakeroot -uc -us'
103 sh -c 'rm osm_nbi/requirements.txt'
104 whitelist_externals = sh
105
106 #######################################################################################
107 [flake8]
108 ignore =
109 W291,
110 W293,
111 W503,
112 E123,
113 E125,
114 E226,
115 E241
116 exclude =
117 .git,
118 __pycache__,
119 .tox,
120 test_mznmodels.py
121 max-line-length = 120
122 show-source = True
123 builtins = _