From 44151051546a93df59c42009bf7a40a4cb65c236 Mon Sep 17 00:00:00 2001 From: Peter Colberg Date: Tue, 21 May 2024 16:55:50 -0400 Subject: [PATCH] scripts: install documentation prerequisites in Python venv Using Python 3.12.3, pip install fails with the error "This environment is externally managed" and recommends to create a virtual environment. Signed-off-by: Peter Colberg --- doc/sphinx/requirements.txt | 39 ++++++++++++++++++++++++---------- docker/docs/Dockerfile | 4 ++-- scripts/build-documentation.sh | 4 +++- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/doc/sphinx/requirements.txt b/doc/sphinx/requirements.txt index 66beffbf1e3d..052e280512b7 100644 --- a/doc/sphinx/requirements.txt +++ b/doc/sphinx/requirements.txt @@ -1,12 +1,29 @@ -babel==2.9.1 -Jinja2==3.1.1 -requests==2.31.0 -docutils==0.14 -pygments==2.15.0 -sphinx==5.0.1 -sphinx-rtd-theme==1.0.0 -sphinx_fontawesome==0.0.6 +alabaster==0.7.16 +Babel==2.15.0 +breathe==4.35.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 +commonmark==0.9.1 +docutils==0.20.1 +idna==3.7 +imagesize==1.4.1 +Jinja2==3.1.4 +Markdown==3.6 +MarkupSafe==2.1.5 +packaging==24.0 +Pygments==2.18.0 +recommonmark==0.7.1 +requests==2.32.2 +snowballstemmer==2.2.0 +Sphinx==7.3.7 sphinx-markdown==1.0.2 -recommonmark==0.7.0 -breathe==4.34.0 -urllib3==1.26.18 +sphinx-rtd-theme==2.0.0 +sphinx_fontawesome==0.0.6 +sphinxcontrib-applehelp==1.0.8 +sphinxcontrib-devhelp==1.0.6 +sphinxcontrib-htmlhelp==2.0.5 +sphinxcontrib-jquery==4.1 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==1.0.7 +sphinxcontrib-serializinghtml==1.1.10 +urllib3==2.2.1 diff --git a/docker/docs/Dockerfile b/docker/docs/Dockerfile index f8b675f89aec..3839e2c2d876 100644 --- a/docker/docs/Dockerfile +++ b/docker/docs/Dockerfile @@ -3,8 +3,8 @@ RUN apt-get update -y RUN apt-get install -y apt-utils RUN apt-get install -y tzdata && dpkg-reconfigure --frontend noninteractive tzdata RUN apt-get install -y build-essential cmake git libjson-c-dev uuid-dev git \ - python3-dev python3-wheel python3-pip doxygen libedit-dev \ - libcap-dev libudev-dev + python3-dev python3-pip python3-venv python3-wheel \ + doxygen libedit-dev libcap-dev libudev-dev WORKDIR /root ENTRYPOINT [ "/bin/bash", "-c" ] diff --git a/scripts/build-documentation.sh b/scripts/build-documentation.sh index 6a41b8c6e6db..6c36a842a3f5 100755 --- a/scripts/build-documentation.sh +++ b/scripts/build-documentation.sh @@ -3,7 +3,9 @@ set -x PYTHON_VERSION=$(python3 --version | cut -d ' ' -f2) #install requirements -python3 -m pip install --user -r doc/sphinx/requirements.txt +python3 -m venv .venv +source .venv/bin/activate +python3 -m pip install -r doc/sphinx/requirements.txt if [ $? != 0 ]; then echo "failed to install Python requirements"