#!/usr/bin/make -f

#export DH_VERBOSE=1
export PYBUILD_NAME=traitlets
export LC_ALL=C.UTF-8
export PYBUILD_TEST_ARGS=--ignore tests/test_typing.py

%:
	dh $@ --buildsystem=pybuild

ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
# Nothing in the built HTML loads the vendored FontAwesome bundles: the theme
# draws its icons from _static/scripts/fontawesome.js, and the webfonts are
# symlinked to fonts-font-awesome by d/python-traitlets-doc.links.
execute_after_dh_auto_build:
	PYTHONPATH=$$(pwd) make -C docs html
	rm -rf docs/build/html/_static/vendor/fontawesome/css \
	       docs/build/html/_static/vendor/fontawesome/js
endif

override_dh_installdocs:
	dh_installdocs -ppython-traitlets-doc --doc-main-package=python3-traitlets
	dh_installdocs --remaining-packages

override_dh_installexamples:
	dh_installexamples -ppython-traitlets-doc --doc-main-package=python3-traitlets
	dh_installexamples --remaining-packages

override_dh_compress:
	dh_compress -ppython-traitlets-doc -X.ttf -X.eot
	dh_compress --remaining-packages

execute_after_dh_auto_clean:
	rm -rf docs/build docs/source/changelog.md
