Repository: pypa/pipenv

Issue:
Install crashes if git clone needs input
There are occasions where a pip editable install from a git repo will ask for input. This causes `pipenv install` to fail with the following.

```
No package provided, installing all dependencies.
Pipfile found at /home/jsatt/dev/summit/summit-knowledge/Pipfile. Considering this to be the project home.
Installing dependencies from Pipfile.lock...
An error occured while installing! 77/80 - 00:00:01
Obtaining django-affect from git+https://github.com/summitesp/django-affect.git@1.1.0#egg=django-affect
What to do?  (s)witch, (i)gnore, (w)ipe, (b)ackup 
  git clone in /home/jsatt/.virtualenvs/sk/src/django-affect exists with URL https://github.com/SummitESP/django-affect.git
  The plan is to install the git repository https://github.com/summitesp/django-affect.git
Exception:
Traceback (most recent call last):
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/commands/install.py", line 335, in run
    wb.build(autobuilding=True)
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/req/req_set.py", line 516, in _prepare_file
    req_to_install.update_editable(not self.is_download)
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/req/req_install.py", line 586, in update_editable
    vcs_backend.obtain(self.source_dir)
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/vcs/git.py", line 138, in obtain
    if self.check_destination(dest, url, rev_options, rev_display):
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/vcs/__init__.py", line 250, in check_destination
    prompt[1])
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 147, in ask_path_exists
    return ask(message, options)
  File "/home/jsatt/.virtualenvs/sk/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 158, in ask
    response = input(message)
EOFError: EOF when reading a line

[================================] 77/80 - 00:00:35
```

Steps to recreate:
1. Add and install git editable repos dependency Pipfile (how every you want to, mine was installed via requirements file before)
2. Edit Pipfile to change case of any characters in repo url (pipenv convert from requirements file lower cased all my repo urls)
3. `pipenv install`, this should fail with the output above.

Expected behavior:
There's a couple possible expected since the command is looking for user input. Could provide a reasonable default for various types of input requests. Could be some why of allowing the user to prove input for their choice.


Discussion:
luckily, we're using delegator, so we could actually provide the password on behalf of the user. 

@jsatt can you provide your pipfile, with the password `xxxxx`'d out?
My use case isn't needing a password. It needs the user to make a choice about changing the remote url of an already installed package.

```
Obtaining django-affect from git+https://github.com/summitesp/django-affect.git@1.1.0#egg=django-affect
What to do?  (s)witch, (i)gnore, (w)ipe, (b)ackup 
```

In my case the difference is just all lower case of the original url (done by pipenv when converting requirements file), but it's also not unheard of to change an install repo from one remote to another for other reasons (point to my own fork which has some bug fixes?).

Perhaps this is a specific enough case that pipenv should always "switch" to the url defined in the Pipfile. However, I suspect there are other edge cases where user input would be needed, like passwords as you suggest, and which would either need a more complete list of these cases or a way to retrieve requested input from the user.
this sounds like an edge case to me
For my case of the lower vs upper case I would agree. In the more likely case of changing to a different fork of a repo, this seems like a pretty big deal for a tool meant to abstract away much of the complexity of package management. It results in a error message that isn't remotely clear as to the actual problem or the proper steps to fix it.

Resolving patch:
diff --git a/pipenv/cli.py b/pipenv/cli.py
--- a/pipenv/cli.py
+++ b/pipenv/cli.py
@@ -738,7 +738,7 @@ def pip_install(package_name=None, r=None, allow_global=False, ignore_hashes=Fal
 
         no_deps = '--no-deps' if no_deps else ''
 
-        pip_command = '"{0}" install {3} {1} -i {2}'.format(which_pip(allow_global=allow_global), install_reqs, source['url'], no_deps)
+        pip_command = '"{0}" install {3} {1} -i {2} --exists-action w'.format(which_pip(allow_global=allow_global), install_reqs, source['url'], no_deps)
 
         if verbose:
             click.echo('$ {0}'.format(pip_command), err=True)


Test patch: