#!/usr/bin/make -f
PYTHON3_VERSIONS=$(shell py3versions -vr)
export PYBUILD_NAME = pexpect

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

override_dh_auto_clean:
	dh_auto_clean
	rm -rf .coverage
#	rm -rf tests/log

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# Testsuite disabled because it timeouts
test-python3-%:
	#PYTHON=python$* py.test-3

override_dh_auto_test: $(foreach pyversion,${PYTHON3_VERSIONS},$(pyversion:%=test-python3-%))
endif

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. http_proxy='127.0.0.1:9' python3 -m sphinx -N -bhtml doc/ build/html

override_dh_installdocs:
	dh_installdocs -ppython-pexpect-doc build/html
	dh_installdocs -A
