Chip Boling | 67b674a | 2019-02-08 11:42:18 -0600 | [diff] [blame] | 1 | ; |
| 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 |
| 18 | envlist = py27 |
| 19 | minversion = 2.5.0 |
| 20 | |
| 21 | [package] |
| 22 | name = pyvoltha |
| 23 | |
| 24 | [cov] |
| 25 | xml = --cov-report xml:{toxworkdir}/{envname}coverage.xml |
| 26 | term = --cov-report term-missing |
| 27 | html = --cov-report html:{toxworkdir}/{envname}cov |
| 28 | branch = --cov-branch |
| 29 | directory =--cov {envsitepackagesdir}/{[package]name} |
| 30 | coverage = {[cov]xml} {[cov]term} {[cov]html} {[cov]branch} {[cov]directory} |
| 31 | cov_fail_under=100 |
| 32 | |
| 33 | [pylama] |
| 34 | format = pylint |
| 35 | skip = */.tox/*,*/.env/* |
| 36 | linters = pep8,pylint |
| 37 | analysis_dirs = {[package]name} test |
| 38 | analysis = pylama {[pylama]analysis_dirs} |
| 39 | |
| 40 | [pylama:pep8] |
| 41 | max_line_length=99 |
| 42 | ignore = E203, W503, R0903 |
| 43 | |
| 44 | [pylama:test/*] |
| 45 | ignore = C0111,R0201,R0903 |
| 46 | |
| 47 | |
| 48 | [pytest] |
| 49 | passenv = {env:PYTEST_ARGS} |
| 50 | flags =-vvl {env:PYTEST_ARGS:} |
| 51 | cov-fail-under=100 |
| 52 | unit_results =--junitxml={toxworkdir}/{envname}_results.xml |
| 53 | test = py.test {[pytest]flags} {[pytest]unit_results} |
| 54 | with_metrics = {[pytest]test} {[cov]coverage} |
| 55 | |
| 56 | [testenv] |
| 57 | basepython = |
| 58 | py27: python2.7 |
| 59 | ;py3: python3 |
| 60 | envdir = |
| 61 | py27: {toxworkdir}/.py27 |
| 62 | ;py3: {toxworkdir}/.py3 |
| 63 | setenv = |
| 64 | COVERAGE_FILE = {envdir}/.coverage |
| 65 | commands = |
| 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 | |
| 82 | deps = |
| 83 | nose |
| 84 | -r{toxinidir}/requirements.txt |
| 85 | -r{toxinidir}/test-requirements.txt |