Skip to content

Commit a4a0373

Browse files
committed
Add tox runner with a handful of jobs
1 parent 14ae7ed commit a4a0373

4 files changed

Lines changed: 80 additions & 0 deletions

File tree

.bandit.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
skips:
2+
- B603 # Ignore warnings about calling subprocess.Popen without shell=True
3+
- B607 # Ignore warnings about calling subprocess.Popen without a full path to executable

.flake8.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[flake8]
2+
show-source = True
3+
# E123, E125 seem invalid
4+
ignore = E123,E125,D104,D100,D101,D102,D103,D106,D107,D412,W504
5+
#enable-extensions=H106,H203,H204,H205,H210,H904
6+
builtins = _
7+
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Revision 0.3.3, released XX-01-2020
33
-----------------------------------
44

5+
- Added tox runner with some basic jobs
56
- Copyright notice extended to the year 2020
67

78
Revision 0.3.2, released 10-01-2020

tox.ini

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[tox]
2+
minversion = 3.4.0
3+
envlist = unittest, flake8, docs, bandit, build
4+
5+
[testenv]
6+
basepython = python3
7+
usedevelop = True
8+
setenv =
9+
VIRTUAL_ENV={envdir}
10+
PYTHONWARNINGS=default::DeprecationWarning
11+
install_command = pip install {opts} {packages}
12+
13+
[testenv:unittest]
14+
deps =
15+
discover
16+
-r{toxinidir}/test-requirements.txt
17+
-r{toxinidir}/requirements.txt
18+
commands = discover -s tests
19+
20+
[testenv:flake8]
21+
skip_install = true
22+
deps =
23+
flake8
24+
# flake8-bugbear
25+
# flake8-colors
26+
# flake8-docstrings
27+
flake8-import-order
28+
# flake8-typing-imports
29+
# pep8-naming
30+
commands =
31+
flake8 --config .flake8.ini --count --import-order-style pep8 --application-import-names apacheconfig apacheconfig tests {posargs}
32+
33+
[testenv:pylint]
34+
deps =
35+
pyflakes
36+
pylint
37+
-r{toxinidir}/requirements.txt
38+
commands =
39+
pylint apacheconfig
40+
41+
[testenv:cover]
42+
setenv =
43+
{[testenv]setenv}
44+
PYTHON=coverage run --parallel-mode
45+
deps =
46+
coverage
47+
discover
48+
commands = coverage erase
49+
coverage run --source apacheconfig -m unittest discover {posargs}
50+
coverage report --fail-under 80
51+
52+
[testenv:bandit]
53+
skip_install = true
54+
deps =
55+
bandit
56+
commands =
57+
bandit -r apacheconfig -c .bandit.yml
58+
59+
[testenv:docs]
60+
skip_install = true
61+
commands = make -C docs html
62+
63+
[testenv:build]
64+
skip_install = true
65+
deps =
66+
wheel
67+
setuptools
68+
commands =
69+
python setup.py -q sdist bdist_wheel

0 commit comments

Comments
 (0)