#!/usr/bin/make -f

# the testsuite leaks open sqlite3 connections, which pytest chokes on otherwise
# see https://github.com/jupyter/nbformat/issues/405
export PYBUILD_TEST_ARGS=-p no:unraisableexception

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

override_dh_auto_install:
	dh_auto_install
	rm -r `find debian/tmp -name tests -type d`

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	PYTHONPATH=. http_proxy=http://127.0.0.1:9 https_proxy=http://127.0.0.1:9 python3 -m sphinx -b html docs debian/python-nbformat-doc/usr/share/doc/python-nbformat-doc/html
	dh_sphinxdoc -O--buildsystem=pybuild
endif
