#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYBUILD_NAME=rich_click

# Some tests use `-m src.rich_click`.
export PYBUILD_BEFORE_TEST := ln -sf {dir}/src {build_dir}/src
export PYBUILD_AFTER_TEST := rm -f {build_dir}/src

# Tests fail if TERM=unknown, which may be the case in some build
# environments.
export PYBUILD_TEST_CUSTOM := 1
export PYBUILD_TEST_ARGS := \
	TERM=xterm {interpreter} -m pytest --no-cov --inline-snapshot=disable

ifneq ($(PYBUILD_AUTOPKGTEST),1)
# Fails when the package is not installed.
PYBUILD_TEST_ARGS += --deselect tests/test_patch.py::test_patch_with_ctx_forward
endif

%:
	dh $@ --buildsystem=pybuild

execute_after_dh_auto_test:
	PYTHONPATH=src debian/tests/run-examples-help
