1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
19 envlist = black, flake8, pylint, pylint-webhook
22 toxworkdir = /tmp/.tox
23 setenv = XDG_CACHE_HOME=/tmp/.cache
27 basepython = python3.10
28 setenv = VIRTUAL_ENV={envdir}
29 PYTHONDONTWRITEBYTECODE = 1
30 deps = -r{toxinidir}/requirements.txt
31 parallel_show_output = true
34 #######################################################################################
39 black
--check
--diff src setup.py
40 black
--check
--diff osm_webhook_translator
43 #######################################################################################
45 deps = {[testenv]deps}
46 -r
{toxinidir
}/requirements
-dev.txt
47 -r
{toxinidir
}/requirements
-test.txt
48 allowlist_externals = sh
50 sh
-c 'rm
-f nosetests.xml'
52 nose2
-C
--coverage src
-s src
53 sh
-c 'mv .coverage .coverage_ngsa'
54 nose2
-C
--coverage osm_webhook_translator
-s osm_webhook_translator
55 sh
-c 'mv .coverage .coverage_webhook_translator'
56 coverage report --omit='*tests*'
57 coverage html -d ./cover --omit='*tests*'
58 coverage xml -o coverage.xml --omit='*tests*'
61 #######################################################################################
67 flake8 osm_webhook_translator
70 #######################################################################################
72 deps = {[testenv]deps}
73 -r
{toxinidir
}/requirements
-dev.txt
74 -r
{toxinidir
}/requirements
-test.txt
78 pylint -E src setup.py --disable=E0401
81 [testenv:pylint-webhook]
82 changedir = {toxinidir}/osm_webhook_translator
83 deps = -r{toxinidir}/osm_webhook_translator/requirements.txt
87 pylint
-E src setup.py
90 #######################################################################################
95 deps = {[testenv]deps}
98 - safety check
--full
-report
101 #######################################################################################
102 [testenv:pip-compile]
103 deps = pip-tools==6.13.0
105 allowlist_externals =
109 bash
-c
"for file in requirements*.in ; do \
111 if [[ $file =~ 'dist' ]] ; then UNSAFE='--allow-unsafe' ; fi ; \
112 pip-compile -rU --resolver=backtracking --no-header $UNSAFE $file ;\
113 out=`echo $file | sed 's/.in/.txt/'` ; \
114 sed -i -e '1 e head -16 tox.ini' $out ;\
116 bash
-c
"for file in osm_webhook_translator/requirements*.in ; do \
118 if [[ $file =~ 'dist' ]] ; then UNSAFE='--allow-unsafe' ; fi ; \
119 pip-compile --resolver=backtracking -rU --no-header $UNSAFE $file ;\
120 out=`echo $file | sed 's/.in/.txt/'` ; \
121 sed -i -e '1 e head -16 tox.ini' $out ;\
125 #######################################################################################
127 deps = {[testenv]deps}
128 -r
{toxinidir
}/requirements
-dist.txt
129 allowlist_externals = sh
131 sh
-c 'cp requirements.txt src
/osm_ngsa
/requirements.txt'
132 sh
-c 'cp README.rst src
/osm_ngsa
/README.rst'
133 python3 setup.py --command-packages=stdeb.command sdist_dsc
134 sh
-c 'cd deb_dist
/osm
-ngsa
*/ && dpkg
-buildpackage
-rfakeroot
-uc
-us'
135 sh
-c 'rm src
/osm_ngsa
/requirements.txt'
136 sh
-c 'rm src
/osm_ngsa
/README.rst'
139 #######################################################################################
140 [testenv:dist_webhook_translator]
141 deps = -r{toxinidir}/osm_webhook_translator/requirements.txt
142 -r
{toxinidir
}/osm_webhook_translator
/requirements
-dist.txt
143 allowlist_externals = sh
145 sh
-c 'cp src
/osm_ngsa
/_version.py osm_webhook_translator
/src
/osm_webhook_translator
/_version.py'
146 sh
-c 'cd osm_webhook_translator
&& cp requirements.txt src
/osm_webhook_translator
/requirements.txt'
147 sh
-c 'cd osm_webhook_translator
&& cp README.rst src
/osm_webhook_translator
/README.rst'
148 sh -c 'cd osm_webhook_translator && python3 setup.py --command-packages=stdeb.command sdist_dsc'
149 sh
-c 'cd osm_webhook_translator
/deb_dist
/osm
-webhook
-translator
*/ && dpkg
-buildpackage
-rfakeroot
-uc
-us'
150 sh
-c 'rm osm_webhook_translator
/src
/osm_webhook_translator
/requirements.txt'
151 sh
-c 'rm osm_webhook_translator
/src
/osm_webhook_translator
/README.rst'
154 #######################################################################################
171 max-line-length = 120
174 import-order-style = google