FAQ | This is a LIVE service | Changelog

Commit c272c6d8 authored by Dean Rasheed's avatar Dean Rasheed
Browse files

Updated the python documentation build environment to use virtualenv.

The old technique was horribly out-dated, and no longer worked on my
machine,
following an OS upgrade.

Tagging this as release 1.1.2.
parent e579ee2a
<project name="utbs-client" default="all" xmlns:if="ant:if">
<property name="api.version" value="1.1.1"/>
<property name="api.version" value="1.1.2"/>
<!-- =================================
target: Java autogen
......
......@@ -5,27 +5,8 @@
#
# Usage: make-pydocs <python-version> <app-version>
#
# Prerequisites:
# ==============
#
# This requires modern versions of Sphinx (>= 1.3.1) and the extension
# sphinxcontrib-fulltoc (>= 1.1), which can be installed using pip.
#
# Note, however, that on OpenSuSE the python3 versions of pip and
# sphinx-build overwrite the versions from python (2), so they need to
# be installed in a very precise order, to prevent the python3 versions
# taking over:
#
# (root) # zypper in python3-pip
# (root) # pip install -U Sphinx
# (root) # pip install sphinxcontrib-fulltoc
# (root) # zypper rm python3-pip
#
# (root) # zypper in -f python-pip
# (root) # pip install -U Sphinx
# (root) # pip install sphinxcontrib-fulltoc
#
# This leaves pip and sphinx-build defaulting to the python (2) versions.
# The parameter <python-version> should be "2.7" or "3.4". This is the
# version of the online Pydocs that we link to.
# -------------------------------------------------------------------------
DIRNAME=$(cd $(dirname "$0") ; pwd -P)
......@@ -64,6 +45,14 @@ DOC_SRCDIR=$(realpath $DIRNAME/../doc/pydocs)
BUILDDIR=$(realpath $DIRNAME/../build/pydocs-$PYTHON_VERSION)
mkdir -p $BUILDDIR
# Setup a virtualenv environment in this directory, with Sphinx and
# sphinxcontrib-fulltoc installed
cd $BUILDDIR
$PYTHON -m virtualenv env
source env/bin/activate
pip install Sphinx
pip install sphinxcontrib-fulltoc
# Copy the relevant Python source code to the build directory, preserving
# its timestamps
rm -rf $BUILDDIR/utbsclient
......@@ -155,5 +144,7 @@ if [[ $PYTHON_VERSION =~ ^3 ]] ; then
fi
$SPHINX_BUILD -b html $BUILDDIR/docs $BUILDDIR/html
deactivate
echo ""
echo "DONE - Output written to $BUILDDIR/html/index.html"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment