#!/usr/bin/make -f
export DH_VERBOSE=1

export PYBUILD_NAME=typer

%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	mkdocs build --clean -d $(CURDIR)/html -f $(CURDIR)/mkdocs.yml
	rm -f $(CURDIR)/html/404.html \
	$(CURDIR)/html/sitemap.xml.gz

override_dh_auto_test:
	PYBUILD_SYSTEM=custom \
	PYBUILD_TEST_ARGS="pytest-3 --cov=typer --cov=tests --cov=docs_src --cov-report=term-missing -o console_output_style=progress --forked --numprocesses=auto" \
	dh_auto_test

ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
override_dh_installdocs:
	dh_installdocs
	dh_mkdocs -Tmkdocs -Treadthedocs -Tlibjs-underscore -Tnode-jquery
endif
