Support running flake8 under tox
authorJeremy Stanley <fungi@yuggoth.org>
Thu, 15 Dec 2016 11:25:38 +0000 (11:25 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Thu, 15 Dec 2016 11:25:38 +0000 (11:25 +0000)
Add the necessary configuration to be able to run `tox` for
performing style checks easily with flake8.

.gitignore
test-requirements.txt [new file with mode: 0644]
tox.ini [new file with mode: 0644]

index fbfa177..e3fe8a1 100644 (file)
@@ -1,3 +1,6 @@
+*.egg-info/
+.eggs/
+.tox/
 capture_*.log
 data/
 mudpy/__pycache__/
diff --git a/test-requirements.txt b/test-requirements.txt
new file mode 100644 (file)
index 0000000..3930480
--- /dev/null
@@ -0,0 +1 @@
+flake8
diff --git a/tox.ini b/tox.ini
new file mode 100644 (file)
index 0000000..041861a
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,21 @@
+[tox]
+minversion = 2.0
+envlist = flake8
+skipsdist = True
+
+[testenv]
+usedevelop = True
+install_command = pip install {opts} {packages}
+setenv =
+   VIRTUAL_ENV={envdir}
+   PYTHONWARNINGS=default::DeprecationWarning
+deps = -r{toxinidir}/test-requirements.txt
+commands = python setup.py test --slowest --testr-args='{posargs}'
+
+[testenv:flake8]
+basepython=python3
+commands = flake8 {posargs}
+
+[flake8]
+show-source = True
+exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build