#! /usr/bin/make -f
export DH_VERBOSE = 1
export PYBUILD_NAME=fastapi
export PYBUILD_BUILD_ARGS={interpreter} debian/setup.py build
export PYBUILD_SYSTEM=custom
%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_clean:
	PYBUILD_SYSTEM=custom PYBUILD_CLEAN_ARGS="{interpreter} debian/setup.py clean" dh_auto_clean

#override_dh_auto_build:
#	PYBUILD_SYSTEM=custom PYBUILD_BUILD_ARGS="{interpreter} debian/setup.py build" dh_auto_build

override_dh_auto_install:
	PYBUILD_SYSTEM=custom PYBUILD_INSTALL_ARGS="{interpreter} debian/setup.py install --root={destdir} --install-layout=deb" dh_auto_install

override_dh_auto_test:
	# tests/test_default_response_class.py -> ModuleNotFoundError: No module named 'orjson'
	# test_get_custom_response -> AssertionError: orjson must be installed to use ORJSONResponse
	# tests/test_tutorial/test_security/test_tutorial005.py -> ModuleNotFoundError: No module named 'jose'
	# tests/test_response_by_alias.py -> TypeError: Field() missing 1 required positional argument: 'default'
	PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="PYTHONPATH=$(CURDIR)/build/lib/ {interpreter} -m pytest tests/ --ignore=tests/test_default_response_class.py --ignore=tests/test_tutorial/test_security/test_tutorial005.py --ignore=tests/test_response_by_alias.py -k ' not test_get_custom_response'" dh_auto_test
