Skip to content

Commit

Permalink
Fixing doctests in gh workflow
Browse files Browse the repository at this point in the history
(cherry picked from commit 74600fe)
  • Loading branch information
timlinux authored and DelazJ committed Feb 19, 2025
1 parent bcd1868 commit 42653f5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ venv
.venv
user.mk
.vscode
shell.nix
vscode.sh
clean.sh
.envrc
.vscode-extensions
core
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ tx_force_pull_translations:
$(eval comma += ,)
tx pull -f --parallel --mode onlytranslated -l $(subst $(space),$(comma),$(subst en$(space),,$(subst zh_,zh-,$(LANGUAGES)))) ;

doctest-gh:
# --system-site-packages needed to keep QGIS libs in python path
export PYTHONPATH=$(PYTHONPATH):/usr/lib/python3/dist-packages && \
. /docsenv/bin/activate --system-site-packages && LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so $(SPHINXBUILD) -b doctest . $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

doctest:
LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so $(SPHINXBUILD) -b doctest . $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
Expand Down
7 changes: 5 additions & 2 deletions doctest.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ FROM qgis/qgis:3.34

# Install requirement first to use caching
COPY REQUIREMENTS.txt /documentation/REQUIREMENTS.txt
RUN pip3 install -r /documentation/REQUIREMENTS.txt

# make the venv in /docsenv
WORKDIR /
RUN python3 -m venv docsenv && . docsenv/bin/activate && pip3 install -r /documentation/REQUIREMENTS.txt

WORKDIR /documentation

CMD make doctest
CMD make doctest-gh

0 comments on commit 42653f5

Please sign in to comment.