This proved simpler because I realized something important: Most of the
code that the old integration was using was in fact doing nothing of
value. Since we can't meaningfully allow users to use command-line
options as parameters to `python setup.py flake8`, we just remove the
work that we do to set up those attributes and parse them.
Previously, we forced Flake8 to be installed in whatever Python
environment that the user was using. This allows someone to use Flake8
from a virtual environment, e.g., if you use the tox.ini from this
commit, you can do:
tox -e venv -- flake8 --install-hook git
And that will allow you to use the Python and Flake8 from
./.tox/venv/bin/python. This means that you can avoid installing
Flake8 globally and still have a working commit hook.
If we create our temporary directory structure for our files, we need
to ensure that all the directories (including the ones in the filename)
exist before we copy the contents to that location.
As per [their blog post of the 27th April](https://blog.readthedocs.com/securing-subdomains/) ‘Securing subdomains’:
> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.
Test Plan: Manually visited all the links I’ve modified.
flake8.main.git.install was already returning False if it couldn't
find the directory to install into. This makes mercurial.install do
the same thing and allows the vcs.install callback to understand that.
Also add the --install-hook option and plumb it's installation through
flake8.main.vcs's function that understands how to install the desired
VCS integration bits.
Finally, we also mock out the mercurial integration.
Certain versions of Python on Windows are capable of using
multiprocessing safely and correctly. Instead of completely disabling
multiprocessing on Windows, this allows us to check for safe versions.
This also updates our internal utility documentation to add missing
functions and add a strongly worded warning about the API of those
functions.