#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

# The bundled ./run_tests also runs style linters (black/flake8/isort) which
# fail on the unformatted 2.58 sources.  Skip the test stage during build.
export DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nocheck

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

override_dh_auto_build:
	release/update-manpages
	dh_auto_build

override_dh_auto_test:
ifneq (nocheck,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	HOME=$(CURDIR) git config --global user.name TestUser
	HOME=$(CURDIR) git config --global user.email '<>'
	HOME=$(CURDIR) git config -l
	HOME=$(CURDIR) ./run_tests -v
endif
