#!/usr/bin/make -f

export http_proxy?=
export https_proxy?=
export PYBUILD_BEFORE_TEST=HOME={home_dir} git config --global user.name "Debian autopkgtest" && HOME={home_dir} git config --global user.email "debian-autopkgtest@example.org"
export PYBUILD_TEST_ARGS=--pyargs neo.test

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_build:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	# FIXME: a number of documentation items require online ressources, and
	# their build fails on some indentation issue in the mixing of
	# documentation with python3 source code.  Until these issues are
	# fixed, the production of sphinx code is disabled.
	#PYTHONPATH=.. $(MAKE) -C doc html

	# Remove embedded javascript libraries.
	-rm doc/build/html/_static/jquery.js
	-rm doc/build/html/_static/underscore.js
	-rm doc/build/html/_static/doctools.js
	-rm doc/build/html/_static/language_data.js
	-rm doc/build/html/_static/searchtools.js
endif

# override_dh_auto_test:
# ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
# 	set -e \
# 	; for PY in $(shell py3versions -r) \
# 	; do echo "I: Running Neo unittests using $$PY" \
# 	;    NOSETESTS_NO_NETWORK=1 $$PY -m pytest -v neo \
# 	; done
# endif
