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

#export DH_VERBOSE = 1

export PYBUILD_NAME=inline-snapshot
export PYBUILD_TEST_ARGS=\
 --ignore tests/test_file.py \
 --ignore tests/test_get_snapshot_value.py \
 --ignore tests/test_inline_snapshot.py \
 --ignore tests/test_pytest_plugin.py \
-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)))
	cp -a CHANGELOG.md CONTRIBUTING.md README.md mkdocs.yml docs src .pybuild && \
	cd .pybuild && \
	PYTHONPATH=`dirname $$(find -type d -name "*dist-info" | head -n1)` && \
	export PYTHONPATH && \
	    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
