1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
|
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable).
# Output every command that modifies files on the build system.
#export DH_VERBOSE = 1
export PYBUILD_NAME=sphinx-needs
# Build with furo theme
export DOCS_THEME=furo
# Workaround for:
# mkdir -p failed for path /nonexistent/.config/matplotlib: [Errno 13] Permission denied: '/nonexistent'
# Matplotlib created a temporary cache directory at /tmp/matplotlib-xxxxx ...
export MPLCONFIGDIR=$(shell mktemp --tmpdir -d matplotlib-XXXXXXX)
ifeq ($(PYBUILD_AUTOPKGTEST),1)
# Skip test requiring test_app0 or plantuml or graphviz or node cypress or test_official (time, memory)
export PYTEST_ADDOPTS="-k not test_app0 and not plantuml and not graphviz and not test_collapse_button_in_variant_doc and not test_collapse_button_in_doc_basic and not test_official"
else
# Skip test requiring node install using unpackaged cypress (https://www.npmjs.com/package/cypress)
# These tests are working only online adding npx dependancy
# Disable unstable test_parallel_execution.py::test_doc_build_html
# The test also fails in auto bluilder (See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1117433)
#export PYTEST_ADDOPTS="-k not test_collapse_button_in_variant_doc and not test_collapse_button_in_doc_basic and not test_doc_build_html and not test_official"
export PYTEST_ADDOPTS="-k not test_app0 and not plantuml and not graphviz and not test_collapse_button_in_variant_doc and not test_collapse_button_in_doc_basic and not test_official"
endif
%:
dh $@ --with sphinxdoc --buildsystem=pybuild
override_dh_auto_build: sphinx_needs/libs/html/datatables.min.js sphinx_needs/libs/html/datatables.min.css
dh_auto_build
#execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9
#execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9
execute_after_dh_auto_build-indep:
# Replace badge downloaded with one debian made.
cp debian/badge.svg docs/
# Replace uptream provided plantuml with debian provided by plantuml package
[ -d docs/utils ] || mkdir docs/utils
if [ ! -L ./docs/utils/plantuml-1.2022.14.jar ] ; then \
ln -s /usr/share/plantuml/plantuml.jar ./docs/utils/plantuml-1.2022.14.jar ; \
fi
# HTML sphinx doc generator
export LANG=en_US.UTF-8; \
export LANGUAGE=en_US.UTF-8; \
export SPHINXOPTS="-D language=en" ; \
export PYTHONHASHSEED=0 ; \
PYTHONPATH=. python3 -m sphinx -N -bhtml \
docs/ build/html
# Remove build log
rm -f build/html/debug_filters.jsonl
# Remove cache
#rm -rf build/.doctrees
override_dh_clean:
-rm -rf .pytest_cache/
-rm -f mem_out.bin
-rm -rf sphinx_needs/__pycache__/
-rm -rf sphinx_needs/api/__pycache__/
-rm -rf sphinx_needs/directives/__pycache__/
-rm -rf sphinx_needs/directives/needflow/__pycache__/
-rm -rf sphinx_needs/functions/__pycache__/
-rm -rf sphinx_needs/nodes/__pycache__/
-rm -rf sphinx_needs/roles/__pycache__/
-rm -rf sphinx_needs/services/__pycache__/
-rm -rf sphinx_needs/services/config/__pycache__/
-rm -rf tests/__pycache__/
-rm -rf tests/benchmarks/__pycache__/
-rm -rf tests/data/__pycache__/
-rm -rf tests/test_services/__pycache__/
-rm -rf tests/test_styles/__pycache__/
-rm -f docs/_static/tutorial_needs.json
-rm -f ./docs/badge.svg
-rm -f sphinx_needs/libs/html/datatables.min.js
-rm -f sphinx_needs/libs/html/datatables.min.css
dh_clean
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# Replace uptream provided plantuml with debian provided by plantuml package
[ -d tests/doc_test/utils ] || mkdir tests/doc_test/utils
ln -s /usr/share/plantuml/plantuml.jar ./tests/doc_test/utils/plantuml.jar
#PYTHONPATH=. python3 -m pytest tests
dh_auto_test
endif
override_dh_compress:
# Do not compress sphinx doc (changelog.html for example)
dh_compress -Xpython-sphinx-needs-doc/html
# Targets used to rebuild minified js and css removed from upstream tarball
sphinx_needs/libs/html/datatables.min.js:
cat \
/usr/share/javascript/jquery-datatables-extensions/JSZip/jszip.min.js \
/usr/share/javascript/jquery-datatables-extensions/pdfmake/build/pdfmake.min.js \
/usr/share/javascript/jquery-datatables-extensions/pdfmake/build/vfs_fonts.js \
/usr/share/javascript/jquery-datatables/jquery.dataTables.min.js \
/usr/share/javascript/jquery-datatables-extensions/Buttons/js/dataTables.buttons.min.js \
/usr/share/javascript/jquery-datatables-extensions/Buttons/js/buttons.colVis.min.js \
/usr/share/javascript/jquery-datatables-extensions/Buttons/js/buttons.html5.min.js \
/usr/share/javascript/jquery-datatables-extensions/Buttons/js/buttons.print.min.js \
/usr/share/javascript/jquery-datatables-extensions/ColReorder/js/dataTables.colReorder.min.js \
/usr/share/javascript/jquery-datatables-extensions/FixedColumns/js/dataTables.fixedColumns.min.js \
/usr/share/javascript/jquery-datatables-extensions/FixedHeader/js/dataTables.fixedHeader.min.js \
/usr/share/javascript/jquery-datatables-extensions/Responsive/js/dataTables.responsive.min.js \
/usr/share/javascript/jquery-datatables-extensions/Scroller/js/dataTables.scroller.min.js \
> $@
sphinx_needs/libs/html/datatables.min.css:
cat \
/usr/share/javascript/jquery-datatables/css/jquery.dataTables.min.css \
/usr/share/javascript/jquery-datatables-extensions/Buttons/css/buttons.dataTables.min.css \
/usr/share/javascript/jquery-datatables-extensions/ColReorder/css/colReorder.dataTables.min.css \
/usr/share/javascript/jquery-datatables-extensions/FixedColumns/css/fixedColumns.dataTables.min.css \
/usr/share/javascript/jquery-datatables-extensions/FixedHeader/css/fixedHeader.dataTables.min.css \
/usr/share/javascript/jquery-datatables-extensions/Responsive/css/responsive.dataTables.min.css \
/usr/share/javascript/jquery-datatables-extensions/Scroller/css/scroller.dataTables.min.css \
> $@
# Build target for dfsg tarball
tarxz:
mk-origtargz ../sphinx-needs-5.1.0.tar.gz
|