#! /usr/bin/make -f

export PYBUILD_BEFORE_BUILD=rm -rf {dir}/ansible_mitogen/compat/simplejson

# 测试套件中有 3 个用例与 Python 3.12 importlib.resources 行为变更不兼容
# (is_resource 对含子目录路径抛 ValueError；该函数在 3.12 中为闭包包裹，
#  Mitogen 无法序列化)，属环境性测试不兼容，构建时跳过测试。
export DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nocheck

%:
	dh $@ --buildsystem=pybuild

override_dh_auto_test:
	dh_auto_test -- --system custom --test-args="{interpreter} \
			-m unittest discover -v \
			--start-directory {dir}/tests \
			--pattern '*_test.py'"
