From 9a6099ffc2982455d631c9d68a3273d9eb55885c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 23 Jul 2015 10:54:39 +0200 Subject: [PATCH] PMGR: Dependency links can make pip install take longer Depending on the pip version pip might first fetch the full index of packages available on PyPI instead of just directly processing the provided link. Display corresponding message to user from backend to make sure they don't think something broke. --- src/octoprint/plugins/pluginmanager/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/octoprint/plugins/pluginmanager/__init__.py b/src/octoprint/plugins/pluginmanager/__init__.py index ef9acb2c..c7950f48 100644 --- a/src/octoprint/plugins/pluginmanager/__init__.py +++ b/src/octoprint/plugins/pluginmanager/__init__.py @@ -423,11 +423,16 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin, if self._pip_caller is None or not self._pip_caller.available: raise RuntimeError(u"No pip available, can't operate".format(**locals())) - if "--process-dependency-links" in args and self._pip_caller < self._pip_version_dependency_links: - args.remove("--process-dependency-links") + if "--process-dependency-links" in args: + self._log_message(u"Installation needs to process external dependencies, that might make it take a bit longer than usual depending on the pip version") + if self._pip_caller < self._pip_version_dependency_links: + args.remove("--process-dependency-links") return self._pip_caller.execute(*args) + def _log_message(self, *lines): + self._log(lines, prefix=u"*", stream="message") + def _log_call(self, *lines): self._log(lines, prefix=u" ", stream="call")