Skip to content

Commit

Permalink
Use a virtualenv for documentation generation (#656)
Browse files Browse the repository at this point in the history
* Use a virtualenv for documentation generation

* Switch publish-doc workflow to virtualenv
  • Loading branch information
tmadlener authored Aug 23, 2024
1 parent 407c84f commit 6387344
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,17 @@ jobs:
view-path: /cvmfs/sw-nightlies.hsf.org/key4hep
run: |
echo "::group::Install dependencies"
python3 -m venv /root/doc-gen-venv
source /root/doc-gen-venv/bin/activate
python3 -m pip install -r doc/requirements.txt
export PATH=/root/.local/bin:$PATH
export PYTHONPATH=/root/.local/lib/python3.10/site-packages:$PYTHONPATH
export PYTHONPATH=$VIRTUAL_ENV/lib/python3.$(python3 -c 'import sys; print(f"{sys.version_info[1]}")')/site-packages:$PYTHONPATH
echo -e "::endgroup::\n::group::Build podio"
cmake -B build . --install-prefix=$(pwd)/install \
-GNinja -DENABLE_SIO=ON -DENABLE_RNTUPLE=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_CXX_STANDARD=17
-DCMAKE_CXX_STANDARD=20
cmake --build build --target install
export PYTHONPATH=$(pwd)/install/python:$PYTHONPATH
export LD_LIBRARY_PATH=$(pwd)/install/lib*/:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=$(pwd)/install/include
source ./init.sh && source ./env.sh
echo -e "::endgroup::\n::group::build doc"
sphinx-build -M html doc doc_output
Expand Down
7 changes: 5 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ generate-docs:
script:
# use the nightlies and install some dependencies on top of them
- source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh
- export PATH=/root/.local/bin:$PATH
- export PYTHONPATH=/root/.local/lib/python3.10/site-packages:$PYTHONPATH
- python3 -m venv /root/doc-gen-venv
- source /root/doc-gen-venv/bin/activate
- python3 -m pip install -r doc/requirements.txt
# For some weird reason we have to make sure that we actually really pick
# the packages we just installed into the venv here
- export PYTHONPATH=$VIRTUAL_ENV/lib/python3.$(python3 -c 'import sys; print(f"{sys.version_info[1]}")')/site-packages:$PYTHONPATH
- cmake -B build . --install-prefix=$(pwd)/install -GNinja -DENABLE_SIO=ON -DENABLE_RNTUPLE=ON -DBUILD_TESTING=OFF -DCMAKE_CXX_STANDARD=20 -DCREATE_DOC=ON
- cmake --build build --target documentation

Expand Down

0 comments on commit 6387344

Please sign in to comment.