Skip to content

Commit

Permalink
Avoid a specific case where conda env update hangs. (conda#11818)
Browse files Browse the repository at this point in the history
When using an environment.yml that asks pip to clone a git repo and
that path exists, pip will ask for user input. As we are not in a
context to provide such, tell pip what to do so it doesn't hang on
waiting for user input.
  • Loading branch information
fragmede authored Sep 29, 2022
1 parent eb3e6a7 commit 07e9fb5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conda_env/installers/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def _pip_install_via_requirements(prefix, specs, args, *_, **kwargs):
requirements.write('\n'.join(specs))
requirements.close()
# pip command line...
pip_cmd = ['install', '-U', '-r', requirements.name]
# see https://pip.pypa.io/en/stable/cli/pip/#exists-action-option
pip_cmd = ['install', '-U', '-r', requirements.name, '--exists-action=b']
stdout, stderr = pip_subprocess(pip_cmd, prefix, cwd=pip_workdir)
finally:
# Win/Appveyor does not like it if we use context manager + delete=True.
Expand Down
21 changes: 21 additions & 0 deletions news/11818-conda-hang
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### Enhancements

* <news item>

### Bug fixes

* `conda env update` would ask for user input and hang when working with pip
installs of git repos and the repo was previously checked out. Tell pip not to
ask for user input for that case. (#11818)

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>

0 comments on commit 07e9fb5

Please sign in to comment.