commit:     805d7b3232e00e444137c8fa060d34fbb7160860
Author:     Arthur Zamarin <arthurzam <AT> gmail <DOT> com>
AuthorDate: Fri Aug  6 06:56:43 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Aug  6 07:03:24 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=805d7b32

dev-python/python-xmlsec: enable py3.10, EAPI=8, fix tests

Signed-off-by: Arthur Zamarin <arthurzam <AT> gmail.com>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../python-xmlsec-1.3.11-fix-xml-testfail.patch    | 23 ++++++++++++++++++++++
 .../python-xmlsec/python-xmlsec-1.3.11.ebuild      | 14 +++++++------
 2 files changed, 31 insertions(+), 6 deletions(-)

diff --git 
a/dev-python/python-xmlsec/files/python-xmlsec-1.3.11-fix-xml-testfail.patch 
b/dev-python/python-xmlsec/files/python-xmlsec-1.3.11-fix-xml-testfail.patch
new file mode 100644
index 00000000000..3e7ab8829c2
--- /dev/null
+++ b/dev-python/python-xmlsec/files/python-xmlsec-1.3.11-fix-xml-testfail.patch
@@ -0,0 +1,23 @@
+Taken from: 
https://github.com/mehcode/python-xmlsec/issues/84#issuecomment-632930116
+diff --git a/tests/base.py b/tests/base.py
+index b05de1d..5ec356f 100644
+--- a/tests/base.py
++++ b/tests/base.py
+@@ -94,6 +94,7 @@ class TestMemoryLeaks(unittest.TestCase):
+ 
+     def load_xml(self, name, xpath=None):
+         """returns xml.etree"""
++        etree.set_default_parser(parser=etree.XMLParser())
+         root = etree.parse(self.path(name)).getroot()
+         if xpath is None:
+             return root
+diff --git a/tests/test_doc_examples.py b/tests/test_doc_examples.py
+index 2fc490f..53d2377 100644
+--- a/tests/test_doc_examples.py
++++ b/tests/test_doc_examples.py
+@@ -42,3 +42,5 @@ def test_doc_example(example):
+     """
+     with cd(example.parent):
+         runpy.run_path(str(example))
++    from lxml import etree
++    etree.set_default_parser(parser=etree.XMLParser())

diff --git a/dev-python/python-xmlsec/python-xmlsec-1.3.11.ebuild 
b/dev-python/python-xmlsec/python-xmlsec-1.3.11.ebuild
index 2cdbbac944b..a43d02473ec 100644
--- a/dev-python/python-xmlsec/python-xmlsec-1.3.11.ebuild
+++ b/dev-python/python-xmlsec/python-xmlsec-1.3.11.ebuild
@@ -1,9 +1,9 @@
 # Copyright 2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{8..10} )
 inherit distutils-r1
 
 DESCRIPTION="Python bindings for the XML Security Library"
@@ -23,11 +23,13 @@ RDEPEND="${DEPEND}
 BDEPEND="${RDEPEND}
        dev-python/pkgconfig[${PYTHON_USEDEP}]
        dev-python/wheel[${PYTHON_USEDEP}]
-"
+       test? (
+               dev-python/hypothesis[${PYTHON_USEDEP}]
+       )"
 
-# tests fail, has been reported upstream
-# https://github.com/mehcode/python-xmlsec/issues/84
-RESTRICT=test
+PATCHES=(
+       "${FILESDIR}/${P}-fix-xml-testfail.patch"
+)
 
 distutils_enable_tests pytest
 

Reply via email to