#!/usr/bin/make -f
export PYBUILD_TEST_ARGS=-k "not test_callable" -m "not request" --pyargs xyzservices.tests

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build $@ --buildsystem=pybuild
	dh_doc_privacy README.md doc
	cd doc; PYTHONPATH=$(CURDIR)/src LC_ALL=C.UTF-8 LANGUAGE=C.UTF-8 sphinx-build -bhtml -d _build/doctrees source _build/html
	sed -i 's|<img src="https://docs.onemap.sg/maps/images/oneMap64-01.png" style="height:20px;width:20px;"/>||g' doc/_build/html/introduction.html
	sed -i '\|<script src="https://cdnjs\.cloudflare\.com|,\|<script src="_static/generate_gallery\.js|d' doc/_build/html/gallery.html
	sed -i 's|<script>initLeafletGallery[^<]*</script>||' doc/_build/html/gallery.html

override_dh_auto_test:
	dh_auto_test
	rm -r ./.pybuild/*/build/.pytest_cache
