diff --git a/0001-fix-tests-with-newer-libxml2.patch b/0001-fix-tests-with-newer-libxml2.patch new file mode 100644 index 0000000000000000000000000000000000000000..42940f2fb8714adeb655705e384d19509d9ce9b0 --- /dev/null +++ b/0001-fix-tests-with-newer-libxml2.patch @@ -0,0 +1,28 @@ +From b948c416a89dd123944835fc5778eeb12ef091fc Mon Sep 17 00:00:00 2001 +From: FFrog +Date: Wed, 9 Feb 2022 11:08:47 +0800 +Subject: [PATCH] fix tests with newer libxml2 + +--- + src/lxml/tests/test_etree.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py +index 9cf7060..42613dc 100644 +--- a/src/lxml/tests/test_etree.py ++++ b/src/lxml/tests/test_etree.py +@@ -3036,7 +3036,10 @@ class ETreeOnlyTestCase(HelperTestCase): + def test_html_prefix_nsmap(self): + etree = self.etree + el = etree.HTML('aa').find('.//page-description') +- self.assertEqual({'hha': None}, el.nsmap) ++ if etree.LIBXML_VERSION < (2, 9, 11): ++ self.assertEqual({'hha': None}, el.nsmap) ++ else: ++ self.assertEqual({}, el.nsmap) + + def test_getchildren(self): + Element = self.etree.Element +-- +2.23.0 + diff --git a/python-lxml.spec b/python-lxml.spec index f48dbf7e0d8404a365e183efc82ee63560bcf839..2bca1e38602745df21e1e79ef688bee49747faa2 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -7,7 +7,7 @@ The latest release works with all CPython versions from 2.7 to 3.7. Name: python-%{modname} Version: 4.5.2 -Release: 5 +Release: 6 Summary: XML processing library combining libxml2/libxslt with the ElementTree API License: BSD URL: http://lxml.de @@ -18,18 +18,12 @@ Patch6001: backport-CVE-2020-27783-2.patch Patch6002: backport-CVE-2021-28957.patch Patch6003: backport-0001-CVE-2021-43818.patch Patch6004: backport-0002-CVE-2021-43818.patch +Patch6005: 0001-fix-tests-with-newer-libxml2.patch BuildRequires: gcc libxml2-devel libxslt-devel %description %{_description} -%package -n python2-%{modname} -Summary: %{summary} -BuildRequires: python2-devel python2-setuptools python2-Cython -%{?python_provide:%python_provide python2-%{modname}} - -%description -n python2-%{modname} %{_description} - %package -n python3-%{modname} Summary: %{summary} BuildRequires: python3-devel python3-setuptools python3-Cython @@ -44,21 +38,14 @@ BuildRequires: python3-devel python3-setuptools python3-Cython %build export WITH_CYTHON=true -%py2_build %py3_build %install -%py2_install %py3_install %check make test3 -%files -n python2-%{modname} -%license doc/licenses/ZopePublicLicense.txt LICENSES.txt -%{python2_sitearch}/%{modname}/ -%{python2_sitearch}/*.egg-info/ - %files -n python3-%{modname} %license doc/licenses/ZopePublicLicense.txt LICENSES.txt %{python3_sitearch}/%{modname}/ @@ -68,6 +55,9 @@ make test3 %doc README.rst src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt %changelog +* Thur Jan 27 2022 lijiawei - 4.5.2-6 +- Remove python2 support and fix tests with newer libxml2 + * Wed Jan 19 2022 shixuantong - 4.5.2-5 - enable check