#!/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

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

# FIXME: the following hack is commented out, as the tip to solve the QIIMETEST
# environment variable issue does not seem to work anymore.  No tests are run
# at build time, they are delayed to the autopkgtest step.

## 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}

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

override_dh_auto_clean:
	dh_auto_clean
	rm -rf qiime2.egg-info
