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

#export DH_VERBOSE = 1

include /usr/share/dpkg/pkg-info.mk

export PYBUILD_NAME=swagger-spec-validator
export PYBUILD_TEST_ARGS=-k 'not test_raise_SwaggerValidationError_on_urlopen_error'

%:
	dh $@ --buildsystem=pybuild

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=`dirname $$(find .pybuild/ -type d -name "swagger_spec_validator" | head -n1)` \
	    python3 -m sphinx -b html -N docs/source $(CURDIR)/debian/python-$(PYBUILD_NAME)-doc/usr/share/doc/python-$(PYBUILD_NAME)-doc/html
	dh_sphinxdoc
endif

override_dh_auto_clean:
	rm -rf docs/source/.build .mypy_cache
	dh_auto_clean
