Missing git crashes the installation, even if not needed at all #2694
Closed
Description
- [x ] I am on the latest Poetry version.
- [x ] I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Docker tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim
DockerFile:
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim
RUN pip install poetry
COPY pyproject.toml .
RUN poetry install --no-dev
- Poetry version: 1.0.5
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/ChristianSauer/2efa7392c4dda0c58976fddd1c17d417
Issue
I would expect that the docker build works because the git dependency is a dev dependency and I asked for a --no-dev install. But poetry fails with this error:
[FileNotFoundError]
[Errno 2] No such file or directory: 'git'
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/usr/local/lib/python3.8/site-packages/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/usr/local/lib/python3.8/site-packages/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/usr/local/lib/python3.8/site-packages/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/usr/local/lib/python3.8/site-packages/poetry/console/commands/install.py", line 69, in handle
return_code = installer.run()
File "/usr/local/lib/python3.8/site-packages/poetry/installation/installer.py", line 74, in run
self._do_install(local_repo)
File "/usr/local/lib/python3.8/site-packages/poetry/installation/installer.py", line 161, in _do_install
ops = solver.solve(use_latest=self._whitelist)
File "/usr/local/lib/python3.8/site-packages/poetry/puzzle/solver.py", line 36, in solve
packages, depths = self._solve(use_latest=use_latest)
File "/usr/local/lib/python3.8/site-packages/poetry/puzzle/solver.py", line 180, in _solve
result = resolve_version(
File "/usr/local/lib/python3.8/site-packages/poetry/mixology/__init__.py", line 7, in resolve_version
return solver.solve()
File "/usr/local/lib/python3.8/site-packages/poetry/mixology/version_solver.py", line 80, in solve
next = self._choose_package_version()
File "/usr/local/lib/python3.8/site-packages/poetry/mixology/version_solver.py", line 388, in _choose_package_version
version = self._provider.complete_package(version)
File "/usr/local/lib/python3.8/site-packages/poetry/puzzle/provider.py", line 601, in complete_package
self.search_for_vcs(r)
File "/usr/local/lib/python3.8/site-packages/poetry/puzzle/provider.py", line 171, in search_for_vcs
package = self.get_package_from_vcs(
File "/usr/local/lib/python3.8/site-packages/poetry/puzzle/provider.py", line 204, in get_package_from_vcs
git = Git()
File "/usr/local/lib/python3.8/site-packages/poetry/vcs/git.py", line 168, in __init__
self._config = GitConfig(requires_git_presence=True)
File "/usr/local/lib/python3.8/site-packages/poetry/vcs/git.py", line 146, in __init__
subprocess.check_output(
File "/usr/local/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/local/lib/python3.8/site-packages/poetry/utils/_compat.py", line 188, in run
process = Popen(*popenargs, **kwargs)
File "/usr/local/lib/python3.8/subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
Also, the error could be better.
Thanks!