#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2023 Marcel Telka
#

%patch% 01-test-requirements.patch
%patch% 02-pydantic.patch
%patch% 03-test-remove-failing.patch

%hook-no-license%
# https://github.com/pylint-dev/pylint/pull/9475
LICENSE='GPL-2.0-only'

%include-3%
# Some tests are failing when run under pytest 8 so we simply remove them.
# https://github.com/pylint-dev/pylint/issues/9477
# https://github.com/pylint-dev/pylint/pull/9576
COMPONENT_PREP_ACTION += \
	for t in \
		i/inconsistent/inconsistent_quotes_fstring \
		i/inconsistent/inconsistent_returns \
		i/invalid/invalid_all/invalid_all_format_valid_5 \
		i/invalid/invalid_all/invalid_all_format_valid_6 \
		n/no/no_name_in_module \
		r/regression/regression_4680 \
		u/unreachable \
		u/undefined/undefined_variable_typing \
		u/unused/unused_import_assigned_to \
		u/use/use_yield_from \
		u/used/used_before_assignment \
		u/used/used_before_assignment_else_return \
	; do \
		$(RM) -r $(SOURCE_DIR)/tests/functional/$${t}.* ; \
	done ;

# Test results order varies between runs
PYTEST_SORT_TESTS = yes

# Random directory name
COMPONENT_TEST_TRANSFORMS += "-e 's|/tmp/.*/garbage[^/]*|\$$(TMPDIR)|'"