https://github.com/pypa/pip/blob/1.1/tests/test_pip.py#L360