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

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

export PYBUILD_NAME=lmfit
export PYBUILD_TEST_ARGS=-k 'not speed and not test_model_nan_policy'

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

override_dh_auto_install:
	dh_auto_install
	dh_numpy3

override_dh_auto_test: export PYBUILD_BEFORE_TEST=cp -r NIST_STRD examples {build_dir}
override_dh_auto_test: export PYBUILD_AFTER_TEST=rm -fr {build_dir}/NIST_STRD {build_dir}/examples; find {build_dir} -name "*.sav" -delete
override_dh_auto_test:
	dh_auto_test

override_dh_installdocs-indep:
	PYTHONPATH=. http_proxy='localhost' python3 -m sphinx -N -bhtml -D mathjax_path="/usr/share/javascript/mathjax/MathJax.js" doc/ build/html  # HTML generator
	dh_installdocs -i
	dh_installdocs build/html -p python-lmfit-doc --doc-main-package=python3-lmfit
