Add diagnostics to the documentation build script

This commit is contained in:
vitaut 2015-10-13 08:45:49 -07:00
parent 7732688b80
commit 5bc908623c

View File

@ -3,7 +3,7 @@
from __future__ import print_function from __future__ import print_function
import os, shutil, tempfile import os, shutil, tempfile
from subprocess import check_call, CalledProcessError, Popen, PIPE from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE
def pip_install(package, commit=None, **kwargs): def pip_install(package, commit=None, **kwargs):
"Install package using pip." "Install package using pip."
@ -15,13 +15,14 @@ def pip_install(package, commit=None, **kwargs):
if stdout and check_version in stdout: if stdout and check_version in stdout:
print('{} already installed'.format(package)) print('{} already installed'.format(package))
return return
elif p.returncode != 0: if p.returncode != 0:
# Old versions of pip such as the one installed on Travis don't support # Old versions of pip such as the one installed on Travis don't support
# the show command - continue installation in this case. # the show command - continue installation in this case.
# Otherwise throw CalledProcessError. # Otherwise throw CalledProcessError.
if p.returncode > 1 and 'No command by the name pip show' not in stderr: if p.returncode > 1 and 'No command by the name pip show' not in stderr:
raise CalledProcessError(p.returncode, cmd) raise CalledProcessError(p.returncode, cmd)
package = 'git+git://github.com/{0}.git@{1}'.format(package, commit) package = 'git+git://github.com/{0}.git@{1}'.format(package, commit)
print('Installing {}'.format(package))
check_call(['pip', 'install', '-q', package]) check_call(['pip', 'install', '-q', package])
def build_docs(): def build_docs():
@ -37,6 +38,7 @@ def build_docs():
check_version='1.4a0.dev-20151013') check_version='1.4a0.dev-20151013')
pip_install('michaeljones/breathe', pip_install('michaeljones/breathe',
'511b0887293e7c6b12310bb61b3659068f48f0f4') '511b0887293e7c6b12310bb61b3659068f48f0f4')
print(check_output(['sphinx-build', '--version']))
# Build docs. # Build docs.
cmd = ['doxygen', '-'] cmd = ['doxygen', '-']
p = Popen(cmd, stdin=PIPE) p = Popen(cmd, stdin=PIPE)