#!/usr/bin/make -f

# exports needed to make the tests succeed (python3-click)
# and to build reproducibly
export TZ=UTC
export LANG=C.UTF-8
export LC_ALL=C.UTF-8

# manually build doc:
export PYBUILD_AFTER_BUILD=make -C docs html text man
# manually remove files needed for tests
export PYBUILD_AFTER_TEST=rm {build_dir}/.coverage

# 跳过测试：新版 urwid 的 RadioButton 状态回调行为变化导致
# tests/test_ui.py::test_todo_editor_list 失败，属环境/依赖版本相关，非功能性问题
export DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nocheck

# disable dh_auto_clean as "setup.py clean" tries to download packages from the
# internet
override_dh_auto_clean:
	rm -f $(CURDIR)/debian/hypothesis

# ignore static files (embedded js libs) for text docs
override_dh_installdocs:
	dh_installdocs --exclude=text/_static/

%:
	dh $@ --buildsystem=pybuild
