#!/usr/bin/make -f

export PYBUILD_NAME=pdf2docx
%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	cd docs && PYTHONPATH=.. make html

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	set -ex; for py in `py3versions --supported 2>/dev/null`; do \
		cd test ; \
		pwd ; \
		PYTHONPATH=.. $${py} -m pytest -v test.py::TestConversion ; \
		make clean ; \
		make docx2pdf ; \
		cd - ; \
	done
endif
