#!/usr/bin/make -f
#export DH_VERBOSE=1

include /usr/share/dpkg/architecture.mk

export PYBUILD_NAME=yt
export HOME=$(CURDIR)/debian/home

export PYBUILD_CLEAN_ARGS=|| true
export PYBUILD_BEFORE_TEST=cp conftest.py {build_dir}
export PYBUILD_AFTER_TEST=rm {build_dir}/conftest.py

# same precision issue as on gammapy
ifeq (i386,$(DEB_HOST_ARCH))
export PYBUILD_TEST_ARGS=--confcutdir=. -k 'not test_grid_arrays_view'
else
export PYBUILD_TEST_ARGS=--confcutdir=.
endif

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

override_dh_installchangelogs:
	dh_installchangelogs doc/source/reference/changelog.rst

override_dh_auto_install:
	dh_auto_install
	find debian/python3-yt -name yt.toml -exec rm {} \;

override_dh_dwz:
	dh_dwz || true  # Ignore potential failures with image_samplers.*.so
