Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a virtualenv for documentation generation #656

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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