#!/usr/bin/make -f

# DH_VERBOSE := 1
export LC_ALL=C.UTF-8
export PYBUILD_SYSTEM=flit
export PYBUILD_TEST_PYTEST=1
export PYBUILD_TEST_ARGS=python{version} -m pytest -n auto -k "not test_own_pyproject"
export PYBUILD_AFTER_INSTALL=rm {destdir}/usr/lib/python{version}/dist-packages/tomli-*dist-info/direct_url.json
# ^ is due to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=969352

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

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	PYBUILD_SYSTEM=custom pybuild --test
endif
# due to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994281
