#!/usr/bin/make -f

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

#export DH_VERBOSE=1
export PYBUILD_NAME=setuptools-scm
# setuptools_support and test_pip_download: network access is disabled
# test_pkg_info_noscmroot and test_use_scm_version_callable: upstream issue #209
TESTS_TO_EXCLUDE=not setuptools_support and not test_pip_download
TESTS_TO_EXCLUDE+=and not test_pkginfo_noscmroot and not test_use_scm_version_callable
export PYBUILD_TEST_ARGS={interpreter} -m pytest -k "$(TESTS_TO_EXCLUDE)"
export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM)

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

override_dh_auto_test:
	python setup.py egg_info
	SETUPTOOLS_SCM_PRETEND_VERSION= PYBUILD_SYSTEM=custom dh_auto_test

override_dh_auto_install:
	python setup.py egg_info
	dh_auto_install
