#!/usr/bin/make -f

export PYBUILD_NAME=django-oauth-toolkit
export PYBUILD_TEST_ARGS=--ds tests.settings
# Disable test that requires a remote host.
PYBUILD_TEST_ARGS += --deselect tests/test_oauth2_validators.py::TestOAuth2ValidatorErrorResourceToken
export PYBUILD_AFTER_TEST=rm -f {build_dir}/.coverage

%:
	dh $@ --buildsystem=pybuild

override_dh_installchangelogs:
	dh_installchangelogs -- docs/changelog.rst


execute_before_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=$(CURDIR) python3 -m sphinx -b html -N $(CURDIR)/docs/ $(CURDIR)/debian/python-django-oauth-toolkit-doc/usr/share/doc/python-django-oauth-toolkit-doc/html
endif
