#!/usr/bin/make -f

# export DH_VERBOSE = 1
export PYBUILD_NAME = tinyarray

# test_conversion 的溢出检测断言依赖浮点转整型的越界行为，该行为随架构而异
# （arm64 上浮点越界转换饱和为 LONG_MAX，x86 上返回不确定值），本包构建时跳过测试。
export DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) nocheck

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

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test -- --test-pytest --test-args=../../../test_tinyarray.py
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf .pytest_cache
	rm -f src/version.hh
	rm -f tinyarray.egg-info/SOURCES.txt
