Drop test-dependency on defusedxml

This commit is contained in:
Miro Hrončok 2025-03-18 15:23:48 +01:00 committed by churchyard
commit bdccc31518

View file

@ -262,6 +262,16 @@ This package contains documentation in the HTML format.
%prep
%autosetup -n sphinx-%{upstream_version} -p1
# Drop test-dependency on defusedxml,
# use xml from the standard library instead.
# defusedxml is safer but this is only used in tests.
# Upstream uses defusedxml to be "safer for future contributors when they
# create/open branches and pull requests" -- that does not concern us.
# https://github.com/sphinx-doc/sphinx/pull/12168#discussion_r1535383868
# We want to avoid the dependency in RHEL, but no harm in doing so unconditionally.
sed -i '/"defusedxml/d' pyproject.toml
sed -i 's/from defusedxml./from xml.etree./' sphinx/testing/util.py tests/test_theming/test_theming.py
%if %{without imagemagick_tests}
rm tests/test_extensions/test_ext_imgconverter.py
%endif