From 69554172367dad4f502e09df312ebc2912e6d0d9 Mon Sep 17 00:00:00 2001 From: vitaut Date: Wed, 20 May 2015 11:10:16 -0700 Subject: [PATCH] Support old version of pip installed on Travis --- doc/build.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/build.py b/doc/build.py index 7eb42dfc..92cc5ec5 100755 --- a/doc/build.py +++ b/doc/build.py @@ -3,12 +3,19 @@ from __future__ import print_function import os, shutil, tempfile -from subprocess import check_call, check_output, Popen, PIPE +from subprocess import check_call, CalledProcessError, Popen, PIPE def pip_install(package, commit=None): "Install package using pip." if commit: - if check_output(['pip', 'show', package.split('/')[1]]): + cmd = ['pip', 'show', package.split('/')[1]] + p = Popen(cmd, stdout=PIPE) + output = p.communicate()[0] + if p.returncode != 0: + if 'No command by the name pip show' in output: + return # Old version of pip - ignore + raise CalledProcessError(p.returncode, cmd) + if output: return # Already installed package = 'git+git://github.com/{0}.git@{1}'.format(package, commit) check_call(['pip', 'install', '-q', package])