diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2020-03-11 13:28:27 -0400 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2020-04-02 13:29:28 +0000 |
commit | a26f54421ae61b1a42c2ff69d3037c428aa238f4 (patch) | |
tree | 5117021cbe2eec4e05d1f5b19090bc57993521c6 /docs/scripts/sphinx-make.sh | |
parent | 57a5a2df5970f61259c9a14b5eb79358a2115b01 (diff) |
docs: Fix venv under python3
See ticket for output under containers for each distro.
Ticket: VPP-1851
Type: docs
Change-Id: I0d80dabeb30d92d09edffa503b05d5eef08313dc
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'docs/scripts/sphinx-make.sh')
-rwxr-xr-x | docs/scripts/sphinx-make.sh | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/docs/scripts/sphinx-make.sh b/docs/scripts/sphinx-make.sh index 36596f219f5..61356bb1b8f 100755 --- a/docs/scripts/sphinx-make.sh +++ b/docs/scripts/sphinx-make.sh @@ -1,20 +1,34 @@ -#!/bin/bash +#!/bin/bash -ex + +# Not refactored to root Makefile because CI calls this from +# makefile in /docs (as if 'make -C docs'). +if [ -z "$PYTHON" ] +then +PYTHON_INTERP=python3 +else +PYTHON_INTERP=$(PYTHON) +fi + +# Get the OS +OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') if [ "$1" == "venv" ] then - OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') + # We need to install the venv package on new systems if [ "$OS_ID" == "ubuntu" ] then - sudo apt-get install -y python3-pip + sudo apt-get install $CONFIRM python3-venv fi if [ "$OS_ID" == "centos" ] then - sudo yum install -y python3-pip + sudo yum install $CONFIRM python3-venv fi - pip3 install --user virtualenv - python3 -m virtualenv $VENV_DIR + + # Install the virtual environment + $PYTHON_INTERP -m venv $VENV_DIR source $VENV_DIR/bin/activate; - pip3 install -r $DOCS_DIR/etc/requirements.txt + $PYTHON_INTERP -m pip install wheel==0.34.2 + $PYTHON_INTERP -m pip install -r $DOCS_DIR/etc/requirements.txt else source $VENV_DIR/bin/activate; VERSION=`source $WS_ROOT/src/scripts/version` |