1 # Copyright 2018 Telefonica S.A.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 envlist = black, cover, flake8, pylint, safety
21 toxworkdir = /tmp/.tox
26 setenv = VIRTUAL_ENV={envdir}
27 PYTHONDONTWRITEBYTECODE = 1
28 deps = -r{toxinidir}/requirements.txt
30 #######################################################################################
35 - black
--check
--diff osm_nbi
/
38 #######################################################################################
40 deps = {[testenv]deps}
41 -r
{toxinidir
}/requirements
-dev.txt
42 -r
{toxinidir
}/requirements
-test.txt
44 sh
-c 'rm
-f nosetests.xml'
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
53 #######################################################################################
57 - flake8 osm_nbi
/ setup.py
60 #######################################################################################
62 deps = {[testenv]deps}
63 -r
{toxinidir
}/requirements
-dev.txt
64 -r
{toxinidir
}/requirements
-test.txt
70 #######################################################################################
75 deps = {[testenv]deps}
78 - safety check
--full
-report
81 #######################################################################################
83 deps = pip-tools==5.5.0
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 ;\
89 whitelist_externals = sh
92 #######################################################################################
94 deps = {[testenv]deps}
95 -r
{toxinidir
}/requirements
-dist.txt
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
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
106 #######################################################################################
121 max-line-length = 120