#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE = 1

export PYBUILD_NAME=strawberry
export PYBUILD_BEFORE_TEST=cp -r {dir}/docs {build_dir}
export PYBUILD_AFTER_TEST=rm -rf {build_dir}/docs
export PYBUILD_AFTER_INSTALL=find {destdir}{install_dir}/strawberry -type f -name "LICENSE" | xargs -r rm -vrf
export DJANGO_SETTINGS_MODULE=tests.django.django_settings

# Tests requiring additionally pyinstrument and opentelemetry to be packaged.
export PYBUILD_TEST_ARGS=\
 --ignore=tests/channels/test_layers.py \
 --ignore=tests/channels/test_testing.py \
 --ignore=tests/extensions/test_custom_objects_for_setting_attribute.py \
 --ignore=tests/extensions/test_pyinstrument.py \
 --ignore=tests/extensions/tracing/test_opentelemetry.py \
 --ignore=tests/http/test_graphql_ide.py \
 --ignore=tests/http/test_graphql_over_http_spec.py \
 --ignore=tests/http/test_query.py \
 --ignore=tests/http/test_query_via_get.py \
 --ignore=tests/http/test_upload.py \
 --ignore=tests/litestar/test_context.py \
 --ignore=tests/litestar/test_response_headers.py \
 --ignore=tests/litestar/test_response_status.py \
 --ignore=tests/sanic/test_file_upload.py \
 --ignore=tests/schema/extensions/test_opentelemetry.py \
 --ignore=tests/websockets/test_graphql_transport_ws.py \
 --ignore=tests/websockets/test_graphql_ws.py \
 -k ' \
     not test_does_only_allow_get_and_post \
 and not test_clients_can_prefer_subprotocols \
 and not test_custom_process_result \
 and not test_extensions \
 and not test_fetch_data_from_db \
 and not test_generally_unsupported_subprotocols_are_rejected \
 and not test_handlers_use_the_views_decode_json_method \
 and not test_handlers_use_the_views_encode_json_method \
 and not test_lazy_types_loaded_from_same_module \
 and not test_multipart_subscription \
 and not test_mutation \
 and not test_query_asserts_errors_option_is_deprecated \
 and not test_query_with_assert_no_errors_option \
 and not test_the_http_handler_uses_the_views_decode_json_method \
 and not test_turning_off_all_subprotocols \
 and not test_turning_off_graphql_transport_ws \
 and not test_turning_off_graphql_ws \
 ' \
 ${NULL}

%:
	dh $@ --buildsystem=pybuild

override_dh_clean:
	dh_clean
	rm -rf .mypy_cache
