forked from qgis/QGIS-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create virtual environment on the fly * Activate doctest with one testcode directive.
- Loading branch information
1 parent
4caa201
commit 23b1e26
Showing
9 changed files
with
165 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
* | ||
!i18n/ | ||
!output/ | ||
!qgis-projects/ | ||
!scripts/ | ||
!source/ | ||
!static/ | ||
!themes/ | ||
!Makefile | ||
!REQUIREMENTS.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ live | |
virtualenv | ||
source/i18n/*/conf.py | ||
source/static/ | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Makefile to run targets in docker containers | ||
|
||
doctest: | ||
docker build -t qgis/documentation:latest -f doctest.dockerfile . | ||
docker run --rm \ | ||
--user=$(shell id -u) \ | ||
--volume=$(PWD):/documentation \ | ||
qgis/documentation:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM qgis/qgis:latest | ||
|
||
# Install requirement first to use caching | ||
COPY REQUIREMENTS.txt /documentation/REQUIREMENTS.txt | ||
RUN pip3 install -r /documentation/REQUIREMENTS.txt | ||
|
||
WORKDIR /documentation | ||
|
||
CMD make doctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Makefile to create and use a python virtual environment on the fly | ||
|
||
# QGIS_PREFIX_PATH, used to determine relative paths. | ||
# Default to system QGIS installation | ||
QGIS_PREFIX_PATH ?= /usr | ||
|
||
# Include system packages (needed for PyQt) | ||
PYTHONPATH ?= /usr/lib/python3/dist-packages | ||
|
||
# Include QGIS binaries and Python binding | ||
ifneq ($(QGIS_PREFIX_PATH), "") | ||
LD_LIBRARY_PATH := $(QGIS_PREFIX_PATH)/lib:$(LD_LIBRARY_PATH) | ||
# For install folder | ||
PYTHONPATH := $(QGIS_PREFIX_PATH)/share/qgis/python:$(PYTHONPATH) | ||
# For build output folder | ||
PYTHONPATH := $(QGIS_PREFIX_PATH)/python:$(PYTHONPATH) | ||
endif | ||
|
||
# Use sphinx from virtualenv | ||
SPHINXBUILD ?= QGIS_PREFIX_PATH=$(QGIS_PREFIX_PATH) LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) PYTHONPATH=$(PYTHONPATH) venv/bin/sphinx-build | ||
SPHINXINTL ?= venv/bin/sphinx-intl | ||
|
||
# Delete all including the virtual environment | ||
cleanall: springclean | ||
rm -rf venv | ||
|
||
# Create the venv and a timestamp file | ||
venv/venv.timestamp: | ||
python3 -m venv venv | ||
touch $@ | ||
|
||
# Install requirements and create a timestamp file | ||
venv/REQUIREMENTS.timestamp: venv/venv.timestamp REQUIREMENTS.txt | ||
venv/bin/pip install -r REQUIREMENTS.txt | ||
touch $@ | ||
|
||
include Makefile | ||
|
||
# Add dependencies to targets that require sphinx | ||
html: venv/REQUIREMENTS.timestamp | ||
gettext: venv/REQUIREMENTS.timestamp | ||
fasthtml: venv/REQUIREMENTS.timestamp | ||
doctest: venv/REQUIREMENTS.timestamp |