#!/usr/bin/make -f
# -*- makefile -*-

## Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#export NOSE_VERBOSE=2

export PYBUILD_NAME=lmfit

## This might have been used, but doctest should be optional
## https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749506
#export PYBUILD_TEST_NOSE=1

# copy the tests to the build dir to be able to pass nose
export PYBUILD_AFTER_BUILD=cp -r NIST_STRD {build_dir}
export PYBUILD_BEFORE_INSTALL=rm -fr {build_dir}/NIST_STRD

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

override_dh_clean:
	rm -rf doc/_static/conf_interval2.png
	rm -rf doc/_static/conf_interval.png
	dh_clean

override_dh_install:
	dh_install
	dh_numpy
	dh_numpy3

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. http_proxy='localhost' sphinx-build -N -bhtml doc/ build/html  # HTML generator

## should be removed once #749506 solved
override_dh_auto_test:
	PYBUILD_SYSTEM=custom \
	PYBUILD_TEST_ARGS='cd {build_dir} && {interpreter} -m nose' \
	dh_auto_test --buildsystem=pybuild
