|
|
6d8727 |
diff --git a/doc/build.py b/doc/build.py
|
|
|
6d8727 |
index e5bcbf3b..73426713 100755
|
|
|
6d8727 |
--- a/doc/build.py
|
|
|
6d8727 |
+++ b/doc/build.py
|
|
|
6d8727 |
@@ -4,27 +4,9 @@
|
|
|
6d8727 |
from __future__ import print_function
|
|
|
6d8727 |
import errno, os, shutil, sys, tempfile
|
|
|
6d8727 |
from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE
|
|
|
6d8727 |
-from distutils.version import LooseVersion
|
|
|
6d8727 |
|
|
|
6d8727 |
versions = ['1.0.0', '1.1.0', '2.0.0', '3.0.2', '4.0.0', '4.1.0', '5.0.0', '5.1.0', '5.2.0', '5.2.1', '5.3.0', '6.0.0', '6.1.0', '6.1.1', '6.1.2', '6.2.0', '6.2.1']
|
|
|
6d8727 |
|
|
|
6d8727 |
-def pip_install(package, commit=None, **kwargs):
|
|
|
6d8727 |
- "Install package using pip."
|
|
|
6d8727 |
- min_version = kwargs.get('min_version')
|
|
|
6d8727 |
- if min_version:
|
|
|
6d8727 |
- from pkg_resources import get_distribution, DistributionNotFound
|
|
|
6d8727 |
- try:
|
|
|
6d8727 |
- installed_version = get_distribution(os.path.basename(package)).version
|
|
|
6d8727 |
- if LooseVersion(installed_version) >= min_version:
|
|
|
6d8727 |
- print('{} {} already installed'.format(package, min_version))
|
|
|
6d8727 |
- return
|
|
|
6d8727 |
- except DistributionNotFound:
|
|
|
6d8727 |
- pass
|
|
|
6d8727 |
- if commit:
|
|
|
6d8727 |
- package = 'git+https://github.com/{0}.git@{1}'.format(package, commit)
|
|
|
6d8727 |
- print('Installing {0}'.format(package))
|
|
|
6d8727 |
- check_call(['pip', 'install', package])
|
|
|
6d8727 |
-
|
|
|
6d8727 |
def create_build_env(dirname='virtualenv'):
|
|
|
6d8727 |
# Create virtualenv.
|
|
|
6d8727 |
if not os.path.exists(dirname):
|
|
|
6d8727 |
@@ -34,30 +16,6 @@ def create_build_env(dirname='virtualenv'):
|
|
|
6d8727 |
activate_this_file = os.path.join(dirname, scripts_dir, 'activate_this.py')
|
|
|
6d8727 |
with open(activate_this_file) as f:
|
|
|
6d8727 |
exec(f.read(), dict(__file__=activate_this_file))
|
|
|
6d8727 |
- # Import get_distribution after activating virtualenv to get info about
|
|
|
6d8727 |
- # the correct packages.
|
|
|
6d8727 |
- from pkg_resources import get_distribution, DistributionNotFound
|
|
|
6d8727 |
- # Upgrade pip because installation of sphinx with pip 1.1 available on Travis
|
|
|
6d8727 |
- # is broken (see #207) and it doesn't support the show command.
|
|
|
6d8727 |
- pip_version = get_distribution('pip').version
|
|
|
6d8727 |
- if LooseVersion(pip_version) < LooseVersion('1.5.4'):
|
|
|
6d8727 |
- print("Updating pip")
|
|
|
6d8727 |
- check_call(['pip', 'install', '--upgrade', 'pip'])
|
|
|
6d8727 |
- # Upgrade distribute because installation of sphinx with distribute 0.6.24
|
|
|
6d8727 |
- # available on Travis is broken (see #207).
|
|
|
6d8727 |
- try:
|
|
|
6d8727 |
- distribute_version = get_distribution('distribute').version
|
|
|
6d8727 |
- if LooseVersion(distribute_version) <= LooseVersion('0.6.24'):
|
|
|
6d8727 |
- print("Updating distribute")
|
|
|
6d8727 |
- check_call(['pip', 'install', '--upgrade', 'distribute'])
|
|
|
6d8727 |
- except DistributionNotFound:
|
|
|
6d8727 |
- pass
|
|
|
6d8727 |
- # Install Sphinx and Breathe.
|
|
|
6d8727 |
- pip_install('sphinx-doc/sphinx', '12b83372ac9316e8cbe86e7fed889296a4cc29ee',
|
|
|
6d8727 |
- min_version='1.4.1.dev20160531')
|
|
|
6d8727 |
- pip_install('michaeljones/breathe',
|
|
|
6d8727 |
- '129222318f7c8f865d2631e7da7b033567e7f56a',
|
|
|
6d8727 |
- min_version='4.2.0')
|
|
|
6d8727 |
|
|
|
6d8727 |
def build_docs(version='dev', **kwargs):
|
|
|
6d8727 |
doc_dir = kwargs.get('doc_dir', os.path.dirname(os.path.realpath(__file__)))
|
|
|
6d8727 |
--
|
|
|
6d8727 |
2.26.2
|
|
|
6d8727 |
|