Add --disable-pip-version-check to pip calls

Users get too confused by the warning the lack of it generates on plugin
installs/uninstalls and updates of any kind through pip. An FAQ entry
on that matter hasn't helped, so we are now pulling out the nuclear
option to reduce support overhead.

Implements #2988
This commit is contained in:
Gina Häußge committed 2019-01-11 14:23:48 +01:00
1 parent d452051c0a
commit d7aae66886
3 files changed
+9 -3

No files matched your search

@@ -363,7 +363,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
raise ValueError("Either URL or path must be provided")
self._logger.info("Installing plugin from {}".format(source))
pip_args = ["install", sarge.shell_quote(source), '--no-cache-dir']
pip_args = ["--disable-pip-version-check", "install", sarge.shell_quote(source), "--no-cache-dir"]
if dependency_links or self._settings.get_boolean(["dependency_links"]):
pip_args.append("--process-dependency-links")
@@ -521,7 +521,7 @@ class PluginManagerPlugin(octoprint.plugin.SimpleApiPlugin,
if origin is None:
origin = plugin.origin[2]
pip_args = ["uninstall", "--yes", origin]
pip_args = ["--disable-pip-version-check", "uninstall", "--yes", origin]
try:
self._call_pip(pip_args)
except:
@@ -86,7 +86,7 @@ def perform_update(target, check, target_version, log_cb=None, online=True, forc
install_arg = check["pip"].format(target_version=target_version, target=target_version)
logger.debug(u"Target: %s, executing pip install %s" % (target, install_arg))
pip_args = ["install", install_arg, "--no-cache-dir"]
pip_args = ["--disable-pip-version-check", "install", install_arg, "--no-cache-dir"]
pip_kwargs = dict()
if pip_working_directory is not None:
pip_kwargs.update(cwd=pip_working_directory)
+6
View File
@@ -27,6 +27,7 @@ class UnknownPip(Exception):
class PipCaller(CommandlineCaller):
process_dependency_links = pkg_resources.Requirement.parse("pip>=1.5")
no_cache_dir = pkg_resources.Requirement.parse("pip>=1.6")
disable_pip_version_check = pkg_resources.Requirement.parse("pip>=6.0")
no_use_wheel = pkg_resources.Requirement.parse("pip==1.5.0")
broken = pkg_resources.Requirement.parse("pip>=6.0.1,<=6.0.3")
@@ -47,6 +48,11 @@ class PipCaller(CommandlineCaller):
logger.debug("Found --no-cache-dir flag, version {} doesn't support that yet though, removing.".format(pip_version))
args.remove("--no-cache-dir")
# strip --disable-pip-version-check for versions that don't support it
if not pip_version in cls.disable_pip_version_check and "--disable-pip-version-check" in args:
logger.debug("Found --disable-pip-version-check flag, version {} doesn't support that yet though, removing.".format(pip_version))
args.remove("--disable-pip-version-check")
# add --no-use-wheel for versions that otherwise break
if pip_version in cls.no_use_wheel and not "--no-use-wheel" in args:
logger.debug("Version {} needs --no-use-wheel to properly work.".format(pip_version))