blob: 490d03e037acae647fa18774ad8b63c35c3ac3c3 [file] [log] [blame]
Adam Israel19c5cfc2019-10-03 12:35:38 -04001# Copyright 2019 Canonical Ltd.
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 implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Adam Israelc3e6c2e2018-03-01 09:31:50 -050015[tox]
beierlm03e807c2020-05-12 15:26:37 -040016envlist = cover, flake8, pylint, pylint-tests
17skipsdist=True
Adam Israel5e08a0e2018-09-06 19:22:47 -040018
Adam Israelc3e6c2e2018-03-01 09:31:50 -050019[testenv]
Adam Israelb2a07f52019-04-25 17:17:05 -040020
beierlm32862bb2020-04-21 16:36:35 -040021[testenv:cover]
22basepython = python3
Adam Israelc3e6c2e2018-03-01 09:31:50 -050023deps =
beierlm32862bb2020-04-21 16:36:35 -040024 nose2
25 -rrequirements.txt
26 -rtest-requirements.txt
Adam Israel5e08a0e2018-09-06 19:22:47 -040027commands =
beierlm32862bb2020-04-21 16:36:35 -040028 coverage erase
29 nose2 -C --coverage n2vc --plugin nose2.plugins.junitxml -s n2vc
30 coverage report --omit='*tests*'
31 coverage html -d ./cover --omit='*tests*'
32 coverage xml -o coverage.xml --omit='*tests*'
Adam Israelc3e6c2e2018-03-01 09:31:50 -050033
beierlm32862bb2020-04-21 16:36:35 -040034[testenv:pylint]
35basepython = python3
Adam Israelc3e6c2e2018-03-01 09:31:50 -050036deps =
beierlm32862bb2020-04-21 16:36:35 -040037 pylint
38 -rrequirements.txt
39commands =
beierlm03e807c2020-05-12 15:26:37 -040040 pylint -E n2vc --ignore=tests
41
42[testenv:pylint-tests]
43basepython = python3
44deps =
45 pylint
46 -rrequirements.txt
47 -rtest-requirements.txt
48commands =
49 pylint -E n2vc.tests
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040050
beierlm32862bb2020-04-21 16:36:35 -040051[testenv:black]
52basepython = python3
53deps =
54 black
55commands =
56 black --check --diff n2vc
57
58[testenv:flake8]
59basepython = python3
60deps =
61 flake8
62 -rrequirements.txt
63commands =
64 flake8 n2vc
65
66[flake8]
67# W503 is invalid PEP-8
68max-line-length = 88
69show-source = True
70ignore = W503,E203
71exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,devops_stages/*,.rst
Adam Israel5e08a0e2018-09-06 19:22:47 -040072
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040073[testenv:build]
Adam Israel5e08a0e2018-09-06 19:22:47 -040074deps =
beierlm32862bb2020-04-21 16:36:35 -040075 stdeb
76 setuptools-version-command
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040077commands = python3 setup.py --command-packages=stdeb.command bdist_deb