#!/usr/bin/make -f

export DH_VERBOSE=1
export PYBUILD_VERBOSE=1

export PYBUILD_NAME=hgapi
export PYBUILD_TEST_PYTEST=1

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

override_dh_auto_test:
	PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS='PYTHONPATH=. {interpreter} hgapi/testhgapi.py' dh_auto_test

DEB_SPHINXDOC_DOCDIR=$(CURDIR)/debian/python3-hgapi/usr/share/doc/python3-hgapi
override_dh_sphinxdoc-indep: export http_proxy=127.0.0.1:9
override_dh_sphinxdoc-indep: export https_proxy=127.0.0.1:9
override_dh_sphinxdoc-indep:
ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS)))
	PYTHON=python3 PYTHONPATH=$(CURDIR) python3 -m sphinx -b html $(CURDIR)/docs/ $(DEB_SPHINXDOC_DOCDIR)/html
	dh_sphinxdoc -O--buildsystem=python_distutils
endif
