blob: 2ca433c4118fc56b9473d22d4a12efc439ed37e5 [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]
beierlm0a8c9af2020-05-12 15:26:37 -040016envlist = cover, flake8, pylint, pylint-tests
beierlmd5989142020-05-06 12:05:16 -040017skipsdist=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
beierlmf52cb7c2020-04-21 16:36:35 -040021[testenv:cover]
22basepython = python3
Adam Israelc3e6c2e2018-03-01 09:31:50 -050023deps =
beierlmf52cb7c2020-04-21 16:36:35 -040024 nose2
25 -rrequirements.txt
26 -rtest-requirements.txt
Adam Israel5e08a0e2018-09-06 19:22:47 -040027commands =
beierlmf52cb7c2020-04-21 16:36:35 -040028 coverage erase
29 nose2 -C --coverage n2vc --plugin nose2.plugins.junitxml -s n2vc
Dominik Fleischmannb78b3e02020-07-07 13:11:19 +020030 coverage report --omit='*n2vc/tests*'
31 coverage html -d ./cover --omit='*n2vc/tests*'
32 coverage xml -o coverage.xml --omit='*n2vc/tests*'
Adam Israelc3e6c2e2018-03-01 09:31:50 -050033
beierlmf52cb7c2020-04-21 16:36:35 -040034[testenv:pylint]
35basepython = python3
Adam Israelc3e6c2e2018-03-01 09:31:50 -050036deps =
David Garciaa4ae9d32021-02-23 10:38:17 +010037 pylint==2.5.3
beierlmf52cb7c2020-04-21 16:36:35 -040038 -rrequirements.txt
39commands =
beierlm0a8c9af2020-05-12 15:26:37 -040040 pylint -E n2vc --ignore=tests
41
42[testenv:pylint-tests]
43basepython = python3
44deps =
David Garciaa4ae9d32021-02-23 10:38:17 +010045 pylint==2.5.3
beierlm0a8c9af2020-05-12 15:26:37 -040046 -rrequirements.txt
47 -rtest-requirements.txt
48commands =
49 pylint -E n2vc.tests
Mike Marchetti4b81dfa2018-04-18 10:52:18 -040050
beierlmf52cb7c2020-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
David Garcia4fee80e2020-05-13 12:18:38 +020068max-line-length = 100
beierlmf52cb7c2020-04-21 16:36:35 -040069show-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 =
beierlmf52cb7c2020-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