#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk

export PYBUILD_TEST_ARGS=--no-cov -p no:cacheprovider
ifeq ($(DEB_HOST_ARCH),i386)
# The test tries to construct a datetime at 0001-01-02 and get its
# timestamp, which is out of range for time_t on i386.
PYBUILD_TEST_ARGS += --deselect _python_utils_tests/test_time.py::test_format_time_keeps_max_when_wall_clock_overflows
endif

%:
	dh $@ --buildsystem=pybuild

ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
execute_after_dh_auto_build:
	dh_doc_privacy README.md docs
	cd docs && PYTHONPATH="$(CURDIR)" sphinx-build -M html . _build
endif


execute_after_dh_auto_clean:
	rm -rf python_utils.egg-info docs/_build
