Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pipenv: handle installs with missing system deps
Raise a `DependencyFileNotResolvable` error when pipenv fails to install dependencies require missing system level dependenceis. The error message parsing is pretty gnarly as the only reference of the offending dependency is in a tmp build path in the error message. In the test case pipenv failed to install `rtree` because it requires a system level dependency: `libspatialindex`. We don't want to install this in our ever growning dockerfile so attempt to explain the error to users. The underlying cause might be obscured by this open issue in pipenv: pypa/pipenv#2791 Similarly, there's an open issue to fix the system requirement in rtree: Toblerity/rtree#147 This is the error pipenv raises: ``` pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmp8jk2atvgbuild/rtree/ File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/resolver.py", line 126, in <module> main() File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/resolver.py", line 118, in main _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system, File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/resolver.py", line 78, in _main results = resolve( File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/resolver.py", line 61, in resolve return resolve_deps( File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/utils.py", line 718, in resolve_deps resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps( File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps resolved_tree = resolver.resolve() File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/utils.py", line 385, in resolve results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS) File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve has_changed, best_matches = self._resolve_one_round() File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round for dep in self._iter_dependencies(best_match): File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies dependencies = self.repository.get_dependencies(ireq) File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies legacy_results = self.get_legacy_dependencies(ireq) File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache) File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs results = resolver._resolve_one(reqset, ireq) File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 211, in _get_abstract_dist_for abstract_dist = self.preparer.prepare_linked_requirement( File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_ abstract_dist.prep_for_dist(finder, self.build_isolation) File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist self.req.run_egg_info() File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 470, in run_egg_info call_subprocess( File "/usr/local/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 703, in call_subprocess raise InstallationError( pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmp8jk2atvgbuild/rtree/ ```
- Loading branch information