#
# 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-not-needed-for-tests.patch
%patch% 02-no-ruff.patch
%patch% 03-test-deps-optional.patch
%patch% 05-no-pre-commit.patch

%hook-no-license%
# https://github.com/PyCQA/astroid/issues/1966
LICENSE="LGPL-2.1-only"

%include-3%
# https://github.com/pylint-dev/astroid/issues/2392
PYTEST_ADDOPTS += --deselect tests/brain/test_dataclasses.py::test_pydantic_field
# fails with tox-current-env
PYTEST_ADDOPTS += --deselect tests/test_modutils.py::GetModulePartTest::test_known_values_get_builtin_module_part
# https://github.com/pylint-dev/astroid/issues/2442
PYTEST_ADDOPTS += --deselect tests/brain/numpy/test_core_einsumfunc.py::test_numpy_function_calls_inferred_as_ndarray
PYTEST_ADDOPTS += --deselect tests/brain/numpy/test_core_fromnumeric.py::BrainNumpyCoreFromNumericTest::test_numpy_function_calls_inferred_as_ndarray
PYTEST_ADDOPTS += --deselect tests/brain/numpy/test_core_multiarray.py::BrainNumpyCoreMultiarrayTest::test_numpy_function_calls_inferred_as_ndarray
PYTEST_ADDOPTS += --deselect tests/brain/numpy/test_core_numerictypes.py::NumpyBrainCoreNumericTypesTest::test_datetime_astype_return
PYTEST_ADDOPTS += --deselect tests/brain/numpy/test_core_numerictypes.py::NumpyBrainCoreNumericTypesTest::test_generic_types_are_subscriptables
PYTEST_ADDOPTS += --deselect tests/brain/numpy/test_core_umath.py::NumpyBrainCoreUmathTest::test_numpy_core_umath_functions_return_type
PYTEST_ADDOPTS += --deselect tests/test_regrtest.py::NonRegressionTests::test_numpy_distutils

# Random temporary dir name
COMPONENT_TEST_TRANSFORMS += "-e 's|\(/tmp\).\{8\}/|\1XXXXXXXX/|g'"
# Random temporary file name
COMPONENT_TEST_TRANSFORMS += "-e 's|\(/tmp\).\{8\}\.py|\1XXXXXXXX.py|g'"