fmt/doc-build-removed-all-pip-internet-stuff.patch
2020-04-06 19:22:52 +02:00

67 lines
2.8 KiB
Diff

diff --git a/doc/build.py b/doc/build.py
index a7bfcf73..7df640bb 100755
--- a/doc/build.py
+++ b/doc/build.py
@@ -4,27 +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
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']
-def pip_install(package, commit=None, **kwargs):
- "Install package using pip."
- min_version = kwargs.get('min_version')
- if min_version:
- from pkg_resources import get_distribution, DistributionNotFound
- try:
- installed_version = get_distribution(os.path.basename(package)).version
- if LooseVersion(installed_version) >= min_version:
- print('{} {} already installed'.format(package, min_version))
- return
- except DistributionNotFound:
- pass
- if commit:
- package = 'git+https://github.com/{0}.git@{1}'.format(package, commit)
- print('Installing {0}'.format(package))
- check_call(['pip', 'install', package])
-
def create_build_env(dirname='virtualenv'):
# Create virtualenv.
if not os.path.exists(dirname):
@@ -34,30 +16,6 @@ def create_build_env(dirname='virtualenv'):
activate_this_file = os.path.join(dirname, scripts_dir, 'activate_this.py')
with open(activate_this_file) as f:
exec(f.read(), dict(__file__=activate_this_file))
- # Import get_distribution after activating virtualenv to get info about
- # the correct packages.
- from pkg_resources import get_distribution, DistributionNotFound
- # 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.
- 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',
- min_version='1.4.1.dev20160531')
- pip_install('michaeljones/breathe',
- '129222318f7c8f865d2631e7da7b033567e7f56a',
- min_version='4.2.0')
def build_docs(version='dev', **kwargs):
doc_dir = kwargs.get('doc_dir', os.path.dirname(os.path.realpath(__file__)))
--
2.25.1