#!/usr/bin/make -f

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

export PYBUILD_NAME = qiime

include /usr/share/dpkg/default.mk

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

# For testing, we need to deploy the project in the build directory
# so that qiime2 plugins are loaded
export PYBUILD_BEFORE_TEST=python{version} setup.py develop --install-dir {build_dir}
# Un-deploy the project and delete site.py script
export PYBUILD_AFTER_TEST=rm -v {build_dir}/site.py; \
	python{version} setup.py develop --uninstall --install-dir {build_dir}

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

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	LC_ALL=C.UTF-8 dh_auto_test -- -s custom --test-args="cd {build_dir}; QIIMETEST= nosetests3"
endif
