Switch to tox

Use the tox virtual environment testing framework to make our
lives easier. The code style and linter programs really belong
there, in the testing environment.

The tox configuration also defines a linter environement
(`tox -e linters`) that is not useful right now. The state of
the codebase is too bad and we will transition step-by-step.
Instead, we have to make sure the new patchsets are validated
and to that extent the linters should be run manually for now.
A pre-commit hook can be installed to run flake8 automatically.

The two linters included with this patch (flake8 and pylint)
use fixed versions to have a consistent linting experience.
They also have their own requirements file since they can be
used independently (or combined, as with tox).

Also, remove the following dependencies:
  - autopep8 as it is not part of the flow (yet);
  - coverage as it is not part of the flow (yet);
  - mccabe (installed by flake8);
  - pep8 that is the older name of pycodestyle (installed by
    flake8);
  - pyflakes (installed by flake8).

Change-Id: Ib5b6ef2860cb83788adee52b4c4716a5b634bc10
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..9f82eb6
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,44 @@
+# tox (https://tox.readthedocs.io/) is a tool for running tests
+# in multiple virtualenvs. This configuration file will run the
+# test suite on all supported python versions. To use it, "pip install tox"
+# and then run "tox" from this directory.
+
+[tox]
+envlist = py35
+# There is no proper way to install the app for now (i.e. setup.py)
+skipsdist = True
+
+[testenv]
+deps =
+    -rrequirements.txt
+    psycopg2
+commands =
+    python manage.py test
+
+# Linters
+[testenv:flake8]
+deps =
+    -rrequirements-dev-flake8.txt
+commands =
+    flake8 crashreports crashreport_stats hiccup
+
+[testenv:pylint]
+deps =
+    -rrequirements.txt
+    -rrequirements-dev-pylint.txt
+commands =
+    pylint crashreports crashreport_stats hiccup
+
+[testenv:linters]
+deps =
+    {[testenv:flake8]deps}
+    {[testenv:pylint]deps}
+commands =
+    {[testenv:flake8]commands}
+    {[testenv:pylint]commands}
+
+# Flake8 configuration
+[flake8]
+format = ${cyan}%(path)s${reset}:${yellow_bold}%(row)d${reset}:${green_bold}%(col)d${reset}: ${red_bold}%(code)s${reset} %(text)s
+import-order-style = google
+max-complexity = 10