summaryrefslogtreecommitdiffstats
path: root/tox.ini
blob: f73818d9cd531db3b04014a3f07a4040c2c61370 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Authors:
#     Christian Heimes <cheimes@redhat.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Copyright (C) 2015 Red Hat, Inc.
# All rights reserved.
#

[tox]
envlist = py27,py35,pep8,pep8py3,lint,lint3k,docs
skip_missing_interpreters = true

[testenv]
# force installation of sphinx and lint in virtual env, otherwise
# the command pick up the `pki` package from the system's site packages.
install_command = pip install {opts} --force-reinstall --upgrade {packages}
deps =
    pytest
sitepackages = True
commands =
    {envpython} {envbindir}/pkidestroy --help
    {envpython} {envbindir}/pkispawn --help
    {envpython} {envbindir}/pki-server --help
    {envpython} {envbindir}/pki-server-upgrade --help
    {envpython} {envbindir}/pki-upgrade --help
    py.test --capture=no --strict tests/python {posargs}

[testenv:lint]
basepython = python2.7
deps =
    pylint
commands =
    {envpython} {toxinidir}/scripts/pylint-build-scan.py tox

[testenv:lint3k]
basepython = python2.7
deps =
    pylint
commands =
    {envpython} {toxinidir}/scripts/pylint-build-scan.py tox -- --py3k

[testenv:lint3]
basepython = python3
deps =
    pylint
commands =
    {envpython} {toxinidir}/scripts/pylint-build-scan.py tox

[testenv:pep8]
basepython = python2.7
sitepackages = False
deps =
    flake8
    # flake8-import-order
    pep8-naming
commands =
    flake8 {posargs}

[testenv:pep8py3]
basepython = python3
sitepackages = False
deps =
    flake8
    # flake8-import-order
    pep8-naming
commands =
    flake8 {posargs}

[testenv:docs]
basepython = python2.7
changedir = base/common/python
deps =
    sphinx < 1.3.0
commands =
    sphinx-build -v -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html

[pytest]
python_files = tests/python/*.py

[flake8]
ignore = N802,N806,N812
exclude = .tox,*.egg,dist,build,conf.py,tests/dogtag/*,.git
filename = *.py,pkidestroy,pki-upgrade,pki-server,pki-server-upgrade,pkispawn,[0-9][0-9]-*
show-source = true
max-line-length = 99
# application-import-names = pki