1 # Copyright 2021 Canonical Ltd.
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # 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, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
15 # For those usages not covered by the Apache License, Version 2.0 please
16 # contact: legal@canonical.com
18 # To get in touch with the maintainers, please contact:
19 # osm-charmers@lists.launchpad.net
21 #######################################################################################
24 envlist = black, cover, flake8, pylint, yamllint, safety
28 toxworkdir = /tmp/.tox
31 basepython = python3.8
34 PYTHONPATH = {toxinidir}:{toxinidir}/lib:{toxinidir}/src
35 PYTHONDONTWRITEBYTECODE = 1
36 deps = -r{toxinidir}/requirements.txt
39 #######################################################################################
43 black
--check
--diff src
/ tests
/
46 #######################################################################################
48 deps = {[testenv]deps}
49 -r
{toxinidir
}/requirements
-test.txt
53 sh
-c 'rm
-f nosetests.xml'
55 nose2
-C
--coverage src
56 coverage report --omit='*tests*'
57 coverage html -d ./cover --omit='*tests*'
58 coverage xml -o coverage.xml --omit=*tests*
59 whitelist_externals = sh
62 #######################################################################################
70 #######################################################################################
72 deps = {[testenv]deps}
73 -r
{toxinidir
}/requirements
-test.txt
79 #######################################################################################
84 deps = {[testenv]deps}
87 - safety check
--full
-report
90 #######################################################################################
92 deps = {[testenv]deps}
93 -r
{toxinidir
}/requirements
-test.txt
97 #######################################################################################
99 passenv=HTTP_PROXY HTTPS_PROXY NO_PROXY
100 whitelist_externals =
105 sh -c 'ubuntu_version=20.04; \
106 architectures="amd64-aarch64-arm64"; \
107 charm_name=`cat metadata.yaml | grep -E "^name: " | cut -f 2 -d " "`; \
108 mv $charm_name
"_ubuntu-"$ubuntu_version
-$architectures.charm $charm_name.charm'
110 #######################################################################################
124 max-line-length = 120
128 import-order-style = google