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

PYTHON2:=$(shell pyversions -vr)
PYTHON3:=$(shell py3versions -vr)
export PYBUILD_NAME=imexam
export MPLBACKEND=Agg

%:
	dh $@ --with python2,python3,sphinxdoc --buildsystem=pybuild

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
test-python%:
	python$* setup.py test -vv --args -v

override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%)
endif

override_dh_installdocs-indep:
	python3 setup.py build_sphinx
	dh_installdocs
