mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-26 12:35:32 +00:00
Support old version of pip installed on Travis, take 2
This commit is contained in:
parent
6955417236
commit
fca83df599
12
doc/build.py
12
doc/build.py
@ -9,13 +9,13 @@ def pip_install(package, commit=None):
|
||||
"Install package using pip."
|
||||
if commit:
|
||||
cmd = ['pip', 'show', package.split('/')[1]]
|
||||
p = Popen(cmd, stdout=PIPE)
|
||||
output = p.communicate()[0]
|
||||
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
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:
|
||||
# Check if pip supports the show command.
|
||||
if 'No command by the name pip show' not in stderr:
|
||||
raise CalledProcessError(p.returncode, cmd)
|
||||
elif stdout:
|
||||
return # Already installed
|
||||
package = 'git+git://github.com/{0}.git@{1}'.format(package, commit)
|
||||
check_call(['pip', 'install', '-q', package])
|
||||
|
Loading…
x
Reference in New Issue
Block a user