#!/usr/bin/make -f

DH_VERBOSE := 1
export LC_ALL=C.UTF-8

include /usr/share/dpkg/default.mk

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

override_dh_auto_install:
	dh_auto_install
	rm -rf debian/q2-sample-classifier/usr/lib/python3.9/site-packages/q2_sample_classifier/__pycache__/
	rm -rf debian/q2-sample-classifier/usr/lib/python3.9/site-packages/q2_sample_classifier/tests/__pycache__/

# FIXME: modules cannot be registered at build time - ignoring build tests for now
override_dh_auto_test:
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test || true
#endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf .pytest_cache build
	rm -f q2_sample_classifier.egg-info/PKG-INFO q2_sample_classifier.egg-info/SOURCES.txt q2_sample_classifier.egg-info/dependency_links.txt q2_sample_classifier.egg-info/entry_points.txt q2_sample_classifier.egg-info/not-zip-safe q2_sample_classifier.egg-info/top_level.txt
	find . -name __pycache__  | xargs -r rm -r

override_dh_usrlocal:
	# fails - no idea why
