#!/usr/bin/make -f

DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1

export PYBUILD_DESTDIR=debian/python3-pairtools/
export PYBUILD_NAME=pairtools

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

execute_after_dh_auto_clean:
	rm -f pairtools/lib/*.c pairtools/lib/regions.cpp

override_dh_auto_test:
	dh_auto_test -- --system=custom --test-args="export CURPY={interpreter}; \
	cd {build_dir} && {interpreter} -m pytest -v -k 'not test_dedup and not test_mock_pysam_parse2_single_end'"

execute_after_dh_auto_install:
	find debian/ -name '*.stats' -delete

override_dh_numpy3:
	dh_numpy3 -p python3-$(PYBUILD_NAME)
