blob: 97b442d734f05c43a1dbcf4b57105a9274f6ff3a [file] [log] [blame]
Chip Boling67b674a2019-02-08 11:42:18 -06001;
2; Copyright 2017 the original author or authors.
3;
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
7;
8; http://www.apache.org/licenses/LICENSE-2.0
9;
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 implied.
13; See the License for the specific language governing permissions and
14; limitations under the License.
15;
16[tox]
17;envlist = py27, py36, py3-analysis, py3-test
18envlist = py27
19minversion = 2.5.0
20
21[package]
22name = pyvoltha
23
24[cov]
25xml = --cov-report xml:{toxworkdir}/{envname}coverage.xml
26term = --cov-report term-missing
27html = --cov-report html:{toxworkdir}/{envname}cov
28branch = --cov-branch
29directory =--cov {envsitepackagesdir}/{[package]name}
30coverage = {[cov]xml} {[cov]term} {[cov]html} {[cov]branch} {[cov]directory}
31cov_fail_under=100
32
33[pylama]
34format = pylint
35skip = */.tox/*,*/.env/*
36linters = pep8,pylint
37analysis_dirs = {[package]name} test
38analysis = pylama {[pylama]analysis_dirs}
39
40[pylama:pep8]
41max_line_length=99
42ignore = E203, W503, R0903
43
44[pylama:test/*]
45ignore = C0111,R0201,R0903
46
47
48[pytest]
49passenv = {env:PYTEST_ARGS}
50flags =-vvl {env:PYTEST_ARGS:}
51cov-fail-under=100
52unit_results =--junitxml={toxworkdir}/{envname}_results.xml
53test = py.test {[pytest]flags} {[pytest]unit_results}
54with_metrics = {[pytest]test} {[cov]coverage}
55
56[testenv]
57basepython =
58 py27: python2.7
59 ;py3: python3
60envdir =
61 py27: {toxworkdir}/.py27
62 ;py3: {toxworkdir}/.py3
63setenv =
64 COVERAGE_FILE = {envdir}/.coverage
65commands =
66; py3-test: {[pytest]with_metrics} test
67; py3-no-coverage: {[pytest]test} test
68; py3-unit: {[pytest]with_metrics} test/unit
69; py3-component: {[pytest]with_metrics} test/component
70; py3-adhoc: {posargs: bash -c 'echo must provide posargs with "tox args -- posargs"'}
71; py3-analysis: {[pylama]analysis}
72; py3-analysis: black --check {[pylama]analysis_dirs}
73; py3-black: black {[pylama]analysis_dirs}
74; py3-docs: sphinx-build -b html docs docs_out
75 py27-test: nosetests {posargs}
76 py27-test: {[pytest]with_metrics} test
77 py27-no-coverage: {[pytest]test} test
78 py27-unit: {[pytest]with_metrics} test/unit
79 py27-component: {[pytest]with_metrics} test/component
80 py27-adhoc: {posargs: bash -c 'echo must provide posargs with "tox args -- posargs"'}
81
82deps =
83 nose
84 -r{toxinidir}/requirements.txt
85 -r{toxinidir}/test-requirements.txt