57 lines
2.3 KiB
Diff
57 lines
2.3 KiB
Diff
--- a/doc/build.py
|
|
+++ b/doc/build.py
|
|
@@ -4,53 +4,9 @@
|
|
from __future__ import print_function
|
|
import errno, os, shutil, sys, tempfile
|
|
from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE
|
|
-from distutils.version import LooseVersion
|
|
-
|
|
-def pip_install(package, commit=None, **kwargs):
|
|
- "Install package using pip."
|
|
- if commit:
|
|
- check_version = kwargs.get('check_version', '')
|
|
- #output = check_output(['pip', 'show', package.split('/')[1]])
|
|
- #if check_version in output:
|
|
- # print('{} already installed'.format(package))
|
|
- # return
|
|
- package = 'git+git://github.com/{0}.git@{1}'.format(package, commit)
|
|
- print('Installing {}'.format(package))
|
|
- check_call(['pip', 'install', package])
|
|
|
|
def build_docs(version='dev'):
|
|
- # Create virtualenv.
|
|
doc_dir = os.path.dirname(os.path.realpath(__file__))
|
|
- virtualenv_dir = 'virtualenv'
|
|
- check_call(['virtualenv', virtualenv_dir])
|
|
- import sysconfig
|
|
- scripts_dir = os.path.basename(sysconfig.get_path('scripts'))
|
|
- activate_this_file = os.path.join(virtualenv_dir, scripts_dir,
|
|
- 'activate_this.py')
|
|
- with open(activate_this_file) as f:
|
|
- exec(f.read(), dict(__file__=activate_this_file))
|
|
- # Upgrade pip because installation of sphinx with pip 1.1 available on Travis
|
|
- # is broken (see #207) and it doesn't support the show command.
|
|
- from pkg_resources import get_distribution, DistributionNotFound
|
|
- pip_version = get_distribution('pip').version
|
|
- if LooseVersion(pip_version) < LooseVersion('1.5.4'):
|
|
- print("Updating pip")
|
|
- check_call(['pip', 'install', '--upgrade', 'pip'])
|
|
- # Upgrade distribute because installation of sphinx with distribute 0.6.24
|
|
- # available on Travis is broken (see #207).
|
|
- try:
|
|
- distribute_version = get_distribution('distribute').version
|
|
- if LooseVersion(distribute_version) <= LooseVersion('0.6.24'):
|
|
- print("Updating distribute")
|
|
- check_call(['pip', 'install', '--upgrade', 'distribute'])
|
|
- except DistributionNotFound:
|
|
- pass
|
|
- # Install Sphinx and Breathe.
|
|
- pip_install('sphinx-doc/sphinx',
|
|
- '12b83372ac9316e8cbe86e7fed889296a4cc29ee',
|
|
- check_version='1.4.1.dev20160525')
|
|
- pip_install('michaeljones/breathe',
|
|
- '1c9d7f80378a92cffa755084823a78bb38ee4acc')
|
|
# Build docs.
|
|
cmd = ['doxygen', '-']
|
|
p = Popen(cmd, stdin=PIPE)
|