#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE = 1

export PYBUILD_NAME=inline-snapshot
export PYBUILD_TEST_ARGS="-k \
    not test_diskstorage \
and not test_empty_sub_snapshot \
and not test_format_command_fail \
and not test_outsource \
and not test_sub_snapshot \
and not test_typing \
and not test_xdist \
and not test_xdist_and_disable \
and not test_xdist_disabled \
"

%:
	dh $@ --buildsystem=pybuild

override_dh_clean:
	rm -rf html .mypy_cache .pytest_cache
	dh_clean

override_dh_auto_build:
	dh_auto_build
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=`dirname $$(find .pybuild/ -type d -name "inline_snapshot*dist-info" | head -n1)` \
	    python3 -m mkdocs build -v --site-dir=html
	rm -f html/requirements.* html/sitemap.xml.gz
endif

override_dh_mkdocs:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	dh_mkdocs
endif

override_dh_installdocs:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	dh_installdocs
endif