#!/usr/bin/make -f

export PYBUILD_NAME=pypuppetdb

# HTTPretty works differently in Python 2 and Python 3, and tests will break in
# one of the two. Keep Python 3 around, disable them for Python 2.
export PYBUILD_DISABLE=test/python2

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

override_dh_installchangelogs:
	dh_installchangelogs CHANGELOG.rst

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test
	$(CURDIR)/bandit.sh
endif

# Remove .coverage which somehow ends up under /usr/lib/python3
override_dh_auto_install:
	dh_auto_install
	find $(CURDIR)/debian/python3-pypuppetdb -name '.coverage' -delete
