summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/lxml')
-rw-r--r--dev-python/lxml/Manifest8
-rw-r--r--dev-python/lxml/files/lxml-3.5.0-cross-compile.patch39
-rw-r--r--dev-python/lxml/files/lxml-4.5.0-tests-pypy.patch434
-rw-r--r--dev-python/lxml/files/lxml-4.5.1-py39.patch620
-rw-r--r--dev-python/lxml/files/lxml-5.1.0-pypy.patch175
-rw-r--r--dev-python/lxml/files/lxml-5.1.1-pypy.patch162
-rw-r--r--dev-python/lxml/lxml-4.5.0.ebuild82
-rw-r--r--dev-python/lxml/lxml-4.5.1.ebuild82
-rw-r--r--dev-python/lxml/lxml-4.5.2.ebuild81
-rw-r--r--dev-python/lxml/lxml-5.1.0.ebuild117
-rw-r--r--dev-python/lxml/lxml-5.1.1.ebuild117
-rw-r--r--dev-python/lxml/lxml-5.2.0.ebuild128
-rw-r--r--dev-python/lxml/lxml-5.2.1.ebuild126
-rw-r--r--dev-python/lxml/lxml-5.2.2.ebuild119
-rw-r--r--dev-python/lxml/metadata.xml19
15 files changed, 960 insertions, 1349 deletions
diff --git a/dev-python/lxml/Manifest b/dev-python/lxml/Manifest
index 8baa79ff5470..2c2267864959 100644
--- a/dev-python/lxml/Manifest
+++ b/dev-python/lxml/Manifest
@@ -1,3 +1,5 @@
-DIST lxml-4.5.0.tar.gz 942013 BLAKE2B 24535fb74c58baff26c47c4bfe4ade0155044b30d099f1990c11406eca34e6bb8255631e5b30172adcf95fc61d1ab9d0384dbf9910c7694beed11cbb99595008 SHA512 b4b4692cffb7b8d074e72033711e17df2529d0747c4d086926855bb5a39478e7aea2bc195d201ca3c252822b231dbe47aaedc647e50bbd6b24754668beaa60ca
-DIST lxml-4.5.1.tar.gz 942377 BLAKE2B 3b7434b50d7f81628f17adf0c65e38c826304674495160a216c3051d86ddd9924f2854cf35453ba8270ca461c4c5429698a002853642f9e52206de1443c6b6f0 SHA512 0f16cdcb8aa7f8c98d3fb625d6713b422c14f0d4e7348cda38eb0776f0cfa637faaabc14dc63f8052f2741c908de6f71cfcb6471d5286c09780816b46cbfb439
-DIST lxml-4.5.2.tar.gz 943480 BLAKE2B 11130d2507ff0d61637d7fef2f4b28c5fbbbfe8864504c8f3a231899be4db14e6be65edc6e780719686605663b0c5f76f161beb509dc58d16ee3a9158a7db59c SHA512 146dcb4414b7f0815c5930048d9dc89711bf0a3ee091c89f4475265cdd6f1690a20f82ec24a282a43cff8854f9b960f0cd4430cff79a7506d39ac1baf7770695
+DIST lxml-5.1.0.gh.tar.gz 962111 BLAKE2B 31c82eb198911d82fd9f7882bf94547b2367f3b3d1183eb8e8f97297b96faa69230d27b3367160b1f732a5d0878296b2d11787c3b220416c81a920e62ebec4f2 SHA512 1fadfeac1fb8b1e4fb1f7f2acb056865eb2567300a6c728eaede380d846ac75a6e33ebebcbbc6d60f54102152afd5dddf970058c4e27af396e9fa58e83c407a7
+DIST lxml-5.1.1.gh.tar.gz 963649 BLAKE2B 0cb7b4e39539ee962cd590b2b2dc644a111a094da9cbccc2ee0c29b9a758d8aca967f989693c76532252909dc44a96a3815273f04f28be2dbeb57d4daae2e6fd SHA512 bb479ca7dcce944a9a3597f67da1b12fb9f3a05592fb8342fe01bc569a86df95c32c7bf1bc0b9cfc0ddffb85adf12612fb2d8622a460357c1aaa56e033476375
+DIST lxml-5.2.0.gh.tar.gz 949400 BLAKE2B 4a1640e1da27504e6a9b5e1c55fa2d51eb2e27f6400b63dae29aa42c6c9bf9a002374d0c4ec3ccd13452efd4f39f0a28dc5989fe7f1da5c80e17b2fb31a0dcae SHA512 5d4faab6430666427a7540b768a81beb5c628e7801a06156a68a03a5f75e424e61b1dfd792b8909e03e8561ffb0be64f62c86a411c110c01a021f4cbf37593f2
+DIST lxml-5.2.1.gh.tar.gz 950408 BLAKE2B d0ad369f9d555a9bcdd92c71fb84063eba864c359d1ff27159c8f6de433bcce6915c9cff31aa7bd99de9aa54cb9a1d7ea7b3bb2526c755f8a38aaa21d9d30dfd SHA512 bd5ab005d617da588f87fa643245916e6963394b167f66991dce6443490692fcbf27620c2208b271bd8a1a97c79b09eedca2d1c6f02ba990a7d88d00ee43edfe
+DIST lxml-5.2.2.gh.tar.gz 950650 BLAKE2B d9e3bd96f386a808eca58ffa9a6b5a79e43102b7161fac9b97905de2bd22d21feaddb093e27463f597ef5378d754011c2999a38953e6288595b8dd171976688b SHA512 20b87a2d6e7ac82b6979d6fd18ecd5c224fec6eeee6b69d47a5bf2947ce53e6a517d1b86ab68836a5974f78ce86551ddc2317c1a7255932b418b98dc64d59376
diff --git a/dev-python/lxml/files/lxml-3.5.0-cross-compile.patch b/dev-python/lxml/files/lxml-3.5.0-cross-compile.patch
deleted file mode 100644
index 82a371c72978..000000000000
--- a/dev-python/lxml/files/lxml-3.5.0-cross-compile.patch
+++ /dev/null
@@ -1,39 +0,0 @@
- setupinfo.py | 18 +++---------------
- 1 file changed, 3 insertions(+), 15 deletions(-)
-
-diff --git a/setupinfo.py b/setupinfo.py
-index e04c38f..0549eaa 100644
---- a/setupinfo.py
-+++ b/setupinfo.py
-@@ -93,19 +93,6 @@ def ext_modules(static_include_dirs, static_library_dirs,
- source_extension = ".c"
- print("Building without Cython.")
-
-- lib_versions = get_library_versions()
-- versions_ok = True
-- if lib_versions[0]:
-- print("Using build configuration of libxml2 %s and libxslt %s" %
-- lib_versions)
-- versions_ok = check_min_version(lib_versions[0], (2, 7, 0), 'libxml2')
-- else:
-- print("Using build configuration of libxslt %s" %
-- lib_versions[1])
-- versions_ok |= check_min_version(lib_versions[1], (1, 1, 23), 'libxslt')
-- if not versions_ok:
-- raise RuntimeError("Dependency missing")
--
- base_dir = get_base_dir()
- _include_dirs = _prefer_reldirs(
- base_dir, include_dirs(static_include_dirs) + [INCLUDE_PACKAGE_PATH])
-@@ -358,8 +345,9 @@ def get_library_versions():
-
-
- def flags(option):
-- xml2_flags = run_command(find_xml2_config(), "--%s" % option)
-- xslt_flags = run_command(find_xslt_config(), "--%s" % option)
-+ pkg_config = os.environ.get('PKG_CONFIG', 'pkg-config')
-+ xml2_flags = run_command(pkg_config, 'libxml-2.0', '--%s' % option)
-+ xslt_flags = run_command(pkg_config, 'libxslt', '--%s' % option)
-
- flag_list = xml2_flags.split()
- for flag in xslt_flags.split():
diff --git a/dev-python/lxml/files/lxml-4.5.0-tests-pypy.patch b/dev-python/lxml/files/lxml-4.5.0-tests-pypy.patch
deleted file mode 100644
index 5f8cad9063fd..000000000000
--- a/dev-python/lxml/files/lxml-4.5.0-tests-pypy.patch
+++ /dev/null
@@ -1,434 +0,0 @@
-From 1804702b5e3c85c1a16014d62365a29d0a6d0c75 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Thu, 30 Jan 2020 06:15:27 +0100
-Subject: [PATCH] Skip tests failing on PyPy
-
----
- src/lxml/tests/test_elementtree.py | 3 +-
- src/lxml/tests/test_errors.py | 3 +-
- src/lxml/tests/test_http_io.py | 3 +-
- src/lxml/tests/test_nsclasses.py | 3 +-
- src/lxml/tests/test_objectify.py | 41 +++++++++++++++++++++++++--
- src/lxml/tests/test_xpathevaluator.py | 7 +++--
- src/lxml/tests/test_xslt.py | 7 +++--
- 7 files changed, 56 insertions(+), 11 deletions(-)
-
-diff --git a/src/lxml/tests/test_elementtree.py b/src/lxml/tests/test_elementtree.py
-index 78d8964d..f3f28044 100644
---- a/src/lxml/tests/test_elementtree.py
-+++ b/src/lxml/tests/test_elementtree.py
-@@ -26,7 +26,7 @@ from .common_imports import (
- BytesIO, etree, HelperTestCase,
- ElementTree, cElementTree, ET_VERSION, CET_VERSION,
- filter_by_version, fileInTestDir, canonicalize, tmpfile,
-- _str, _bytes, unicode, next, IS_PYTHON2
-+ _str, _bytes, unicode, next, IS_PYTHON2, IS_PYPY
- )
-
- if cElementTree is not None and (CET_VERSION <= (1,0,7) or sys.version_info[0] >= 3):
-@@ -2956,6 +2956,7 @@ class _ETreeTestCaseBase(HelperTestCase):
- self.assertEqual('TEST', root2[0].get('{%s}a' % ns_href))
-
- required_versions_ET['test_register_namespace'] = (1,3)
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_register_namespace(self):
- # ET 1.3+
- Element = self.etree.Element
-diff --git a/src/lxml/tests/test_errors.py b/src/lxml/tests/test_errors.py
-index c0aee744..33111429 100644
---- a/src/lxml/tests/test_errors.py
-+++ b/src/lxml/tests/test_errors.py
-@@ -11,7 +11,7 @@ import unittest
- import sys, gc, os.path
- from lxml import etree
-
--from .common_imports import HelperTestCase
-+from .common_imports import HelperTestCase, IS_PYPY
-
-
- class ErrorTestCase(HelperTestCase):
-@@ -25,6 +25,7 @@ class ErrorTestCase(HelperTestCase):
- def test_empty_parse(self):
- self.assertRaises(etree.XMLSyntaxError, etree.fromstring, '')
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_element_cyclic_gc_none(self):
- # test if cyclic reference can crash etree
- Element = self.etree.Element
-diff --git a/src/lxml/tests/test_http_io.py b/src/lxml/tests/test_http_io.py
-index f9eff39a..edf2bd81 100644
---- a/src/lxml/tests/test_http_io.py
-+++ b/src/lxml/tests/test_http_io.py
-@@ -11,10 +11,11 @@ import textwrap
- import sys
- import gzip
-
--from .common_imports import etree, HelperTestCase, BytesIO, _bytes
-+from .common_imports import etree, HelperTestCase, BytesIO, _bytes, IS_PYPY
- from .dummy_http_server import webserver, HTTPRequestCollector
-
-
-+@unittest.skipIf(IS_PYPY, "broken on pypy")
- class HttpIOTestCase(HelperTestCase):
- etree = etree
-
-diff --git a/src/lxml/tests/test_nsclasses.py b/src/lxml/tests/test_nsclasses.py
-index a0aa608d..5aa5dc48 100644
---- a/src/lxml/tests/test_nsclasses.py
-+++ b/src/lxml/tests/test_nsclasses.py
-@@ -9,7 +9,7 @@ from __future__ import absolute_import
-
- import unittest
-
--from .common_imports import etree, HelperTestCase, _bytes, make_doctest
-+from .common_imports import etree, HelperTestCase, _bytes, make_doctest, IS_PYPY
-
- class ETreeNamespaceClassesTestCase(HelperTestCase):
-
-@@ -46,6 +46,7 @@ class ETreeNamespaceClassesTestCase(HelperTestCase):
- self.Namespace('ns02').clear()
- self.Namespace('ns03').clear()
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_ns_classes(self):
- bluff_dict = {'bluff' : self.bluff_class}
- maeh_dict = {'maeh' : self.maeh_class}
-diff --git a/src/lxml/tests/test_objectify.py b/src/lxml/tests/test_objectify.py
-index a12ae7e1..83ba4ced 100644
---- a/src/lxml/tests/test_objectify.py
-+++ b/src/lxml/tests/test_objectify.py
-@@ -9,7 +9,8 @@ from __future__ import absolute_import
- import unittest, operator
-
- from .common_imports import (
-- etree, HelperTestCase, fileInTestDir, doctest, make_doctest, _bytes, _str, BytesIO
-+ etree, HelperTestCase, fileInTestDir, doctest, make_doctest, _bytes, _str, BytesIO,
-+ IS_PYPY
- )
-
- from lxml import objectify
-@@ -213,11 +214,13 @@ class ObjectifyTestCase(HelperTestCase):
- expected.update(DEFAULT_NSMAP)
- self.assertEqual(root.value.nsmap, expected)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_date_element_efactory_text(self):
- # ObjectifiedDataElement can also be used as E-Factory
- value = objectify.ObjectifiedDataElement('test', 'toast')
- self.assertEqual(value.text, 'testtoast')
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_date_element_efactory_tail(self):
- # ObjectifiedDataElement can also be used as E-Factory
- value = objectify.ObjectifiedElement(objectify.ObjectifiedDataElement(), 'test', 'toast')
-@@ -374,6 +377,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertEqual("4", getattr(root.c1, "{}c2").text)
- self.assertEqual("0", getattr(root.c1, "c2").text)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_setattr(self):
- for val in [
- 2, 2**32, 1.2, "Won't get fooled again",
-@@ -809,6 +813,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertEqual(3, len(root.findall(".//b")))
- self.assertEqual(2, len(root.findall("b")))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_build_tree(self):
- root = self.Element('root')
- root.a = 5
-@@ -838,6 +843,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertEqual(value, None)
- self.assertEqual(value.get(XML_SCHEMA_NIL_ATTR), "true")
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_bool(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -871,6 +877,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertTrue(isinstance(value, objectify.BoolElement))
- self.assertEqual(value, False)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_str(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -878,6 +885,7 @@ class ObjectifyTestCase(HelperTestCase):
- root.s = "test"
- self.assertTrue(isinstance(root.s, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_str_intliteral(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -885,6 +893,7 @@ class ObjectifyTestCase(HelperTestCase):
- root.s = "3"
- self.assertTrue(isinstance(root.s, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_str_floatliteral(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -892,6 +901,7 @@ class ObjectifyTestCase(HelperTestCase):
- root.s = "3.72"
- self.assertTrue(isinstance(root.s, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_str_mul(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -904,6 +914,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertRaises(TypeError, operator.mul, root.s, "honk")
- self.assertRaises(TypeError, operator.mul, "honk", root.s)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_str_add(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -914,6 +925,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertEqual("test" + s, root.s + s)
- self.assertEqual(s + "test", s + root.s)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_str_mod(self):
- s = "%d %f %s %r"
- el = objectify.DataElement(s)
-@@ -979,6 +991,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertTrue(isinstance(value, objectify.StringElement))
- self.assertEqual(value, "3.20")
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_ustr(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -986,6 +999,7 @@ class ObjectifyTestCase(HelperTestCase):
- root.s = _str("test")
- self.assertTrue(isinstance(root.s, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_ustr_intliteral(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -993,6 +1007,7 @@ class ObjectifyTestCase(HelperTestCase):
- root.s = _str("3")
- self.assertTrue(isinstance(root.s, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_ustr_floatliteral(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -1000,6 +1015,7 @@ class ObjectifyTestCase(HelperTestCase):
- root.s = _str("3.72")
- self.assertTrue(isinstance(root.s, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_ustr_mul(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -1012,6 +1028,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertRaises(TypeError, operator.mul, root.s, _str("honk"))
- self.assertRaises(TypeError, operator.mul, _str("honk"), root.s)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_ustr_add(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -1037,6 +1054,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertTrue(isinstance(value, objectify.StringElement))
- self.assertEqual(value, _str("3.20"))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_int(self):
- Element = self.Element
- root = Element("{objectified}root")
-@@ -1053,6 +1071,7 @@ class ObjectifyTestCase(HelperTestCase):
- value = objectify.DataElement(123)
- self.assertEqual(hash(value), hash(123))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_float(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -1069,6 +1088,7 @@ class ObjectifyTestCase(HelperTestCase):
- value = objectify.DataElement(5.5)
- self.assertEqual(hash(value), hash(5.5))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_float_precision(self):
- # test not losing precision by shortened float str() value
- # repr(2.305064300557): '2.305064300557'
-@@ -1088,6 +1108,7 @@ class ObjectifyTestCase(HelperTestCase):
- s = "2.305064300557"
- self.assertEqual(objectify.FloatElement(s), float(s))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_float_precision_consistency(self):
- # test consistent FloatElement values for the different instantiation
- # possibilities
-@@ -1169,6 +1190,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertEqual(value.text, None)
- self.assertEqual(value.pyval, None)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_unregistered(self):
- Element = self.Element
- SubElement = self.etree.SubElement
-@@ -1331,6 +1353,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertEqual(["why", "try"],
- strs)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_str_cmp(self):
- XML = self.XML
- root = XML(_bytes('<root><b>test</b><b>taste</b><b></b><b/></root>'))
-@@ -1358,6 +1381,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertEqual(root.b, "")
- self.assertEqual("", root.b)
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_int_cmp(self):
- XML = self.XML
- root = XML(_bytes('<root><b>5</b><b>6</b></root>'))
-@@ -1380,6 +1404,7 @@ class ObjectifyTestCase(HelperTestCase):
-
- # float + long share the NumberElement implementation with int
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_type_bool_cmp(self):
- XML = self.XML
- root = XML(_bytes('<root><b>false</b><b>true</b></root>'))
-@@ -2049,6 +2074,7 @@ class ObjectifyTestCase(HelperTestCase):
- before = [objectify.getRegisteredTypes()[0].name],
- after = [objectify.getRegisteredTypes()[1].name])
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_registered_type_stringify(self):
- from datetime import datetime
- def parse_date(value):
-@@ -2519,46 +2545,55 @@ class ObjectifyTestCase(HelperTestCase):
-
- # E-Factory tests, need to use sub-elements as root element is always
- # type-looked-up as ObjectifiedElement (no annotations)
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_int(self):
- E = objectify.E
- root = E.root(E.val(23))
- self.assertTrue(isinstance(root.val, objectify.IntElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_float(self):
- E = objectify.E
- root = E.root(E.val(233.23))
- self.assertTrue(isinstance(root.val, objectify.FloatElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_str(self):
- E = objectify.E
- root = E.root(E.val("what?"))
- self.assertTrue(isinstance(root.val, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_unicode(self):
- E = objectify.E
- root = E.root(E.val(_str("blöödy häll", encoding="ISO-8859-1")))
- self.assertTrue(isinstance(root.val, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_bool(self):
- E = objectify.E
- root = E.root(E.val(True))
- self.assertTrue(isinstance(root.val, objectify.BoolElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_none(self):
- E = objectify.E
- root = E.root(E.val(None))
- self.assertTrue(isinstance(root.val, objectify.NoneElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_value_concatenation(self):
- E = objectify.E
- root = E.root(E.val(1, "foo", 2.0, "bar ", True, None))
- self.assertTrue(isinstance(root.val, objectify.StringElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_attrib(self):
- E = objectify.E
- root = E.root(foo="bar")
- self.assertEqual(root.get("foo"), "bar")
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_nested(self):
- E = objectify.E
- DataElement = objectify.DataElement
-@@ -2573,6 +2608,7 @@ class ObjectifyTestCase(HelperTestCase):
- self.assertTrue(isinstance(root.value[0], objectify.IntElement))
- self.assertTrue(isinstance(root.value[1], objectify.FloatElement))
-
-+ @unittest.skipIf(IS_PYPY, "broken on pypy")
- def test_efactory_subtype(self):
- class Attribute(objectify.ObjectifiedDataElement):
- def __init__(self):
-@@ -2674,7 +2710,8 @@ def test_suite():
- suite = unittest.TestSuite()
- suite.addTests([unittest.makeSuite(ObjectifyTestCase)])
- suite.addTests(doctest.DocTestSuite(objectify))
-- suite.addTests([make_doctest('../../../doc/objectify.txt')])
-+ if not IS_PYPY:
-+ suite.addTests([make_doctest('../../../doc/objectify.txt')])
- return suite
-
- if __name__ == '__main__':
-diff --git a/src/lxml/tests/test_xpathevaluator.py b/src/lxml/tests/test_xpathevaluator.py
-index 13ee97ec..6d162c6d 100644
---- a/src/lxml/tests/test_xpathevaluator.py
-+++ b/src/lxml/tests/test_xpathevaluator.py
-@@ -8,7 +8,7 @@ from __future__ import absolute_import
-
- import unittest, sys
-
--from .common_imports import etree, HelperTestCase, _bytes, BytesIO, doctest, make_doctest
-+from .common_imports import etree, HelperTestCase, _bytes, BytesIO, doctest, make_doctest, IS_PYPY
-
-
- class ETreeXPathTestCase(HelperTestCase):
-@@ -740,8 +740,9 @@ def test_suite():
- suite.addTests([unittest.makeSuite(ETreeXPathExsltTestCase)])
- suite.addTests([unittest.makeSuite(ETreeETXPathClassTestCase)])
- suite.addTests([doctest.DocTestSuite()])
-- suite.addTests(
-- [make_doctest('../../../doc/xpathxslt.txt')])
-+ if not IS_PYPY:
-+ suite.addTests(
-+ [make_doctest('../../../doc/xpathxslt.txt')])
- return suite
-
- if __name__ == '__main__':
-diff --git a/src/lxml/tests/test_xslt.py b/src/lxml/tests/test_xslt.py
-index cde23357..41f8d78b 100644
---- a/src/lxml/tests/test_xslt.py
-+++ b/src/lxml/tests/test_xslt.py
-@@ -17,6 +17,8 @@ from textwrap import dedent
- from tempfile import NamedTemporaryFile, mkdtemp
-
- is_python3 = sys.version_info[0] >= 3
-+is_pypy = (getattr(sys, 'implementation', None) == 'pypy' or
-+ getattr(sys, 'pypy_version_info', None) is not None)
-
- try:
- unicode
-@@ -2085,8 +2087,9 @@ def test_suite():
- suite.addTests([unittest.makeSuite(Py3XSLTTestCase)])
- suite.addTests(
- [make_doctest('../../../doc/extensions.txt')])
-- suite.addTests(
-- [make_doctest('../../../doc/xpathxslt.txt')])
-+ if not is_pypy:
-+ suite.addTests(
-+ [make_doctest('../../../doc/xpathxslt.txt')])
- return suite
-
- if __name__ == '__main__':
---
-2.25.0
-
diff --git a/dev-python/lxml/files/lxml-4.5.1-py39.patch b/dev-python/lxml/files/lxml-4.5.1-py39.patch
deleted file mode 100644
index 3032e5379272..000000000000
--- a/dev-python/lxml/files/lxml-4.5.1-py39.patch
+++ /dev/null
@@ -1,620 +0,0 @@
-From e5c5cd22d918cd3b196e109a7829dad02d9ef42e Mon Sep 17 00:00:00 2001
-From: Stefan Behnel <stefan_ml@behnel.de>
-Date: Tue, 26 May 2020 11:20:18 +0200
-Subject: [PATCH 1/2] Move some ElementTree compatibility tests over to the
- etree-only tests since the features were removed in Py3.9.
-
----
- src/lxml/tests/test_elementtree.py | 254 +----------------------------
- src/lxml/tests/test_etree.py | 246 ++++++++++++++++++++++++++++
- 2 files changed, 252 insertions(+), 248 deletions(-)
-
-diff --git a/src/lxml/tests/test_elementtree.py b/src/lxml/tests/test_elementtree.py
-index 78d8964d..ec765ee0 100644
---- a/src/lxml/tests/test_elementtree.py
-+++ b/src/lxml/tests/test_elementtree.py
-@@ -130,7 +130,8 @@ class _ETreeTestCaseBase(HelperTestCase):
- check_method(element.extend)
- check_method(element.insert)
- check_method(element.remove)
-- check_method(element.getchildren)
-+ # Removed in Py3.9
-+ #check_method(element.getchildren)
- check_method(element.find)
- check_method(element.iterfind)
- check_method(element.findall)
-@@ -142,7 +143,8 @@ class _ETreeTestCaseBase(HelperTestCase):
- check_method(element.items)
- check_method(element.iter)
- check_method(element.itertext)
-- check_method(element.getiterator)
-+ # Removed in Py3.9
-+ #check_method(element.getiterator)
-
- # These methods return an iterable. See bug 6472.
-
-@@ -1933,28 +1935,6 @@ class _ETreeTestCaseBase(HelperTestCase):
- a.remove(el)
- self.assertLess(len(a), 3)
-
-- def test_getchildren(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- b = SubElement(a, 'b')
-- c = SubElement(a, 'c')
-- d = SubElement(b, 'd')
-- e = SubElement(c, 'e')
-- self.assertXML(
-- _bytes('<a><b><d></d></b><c><e></e></c></a>'),
-- a)
-- self.assertEqual(
-- [b, c],
-- a.getchildren())
-- self.assertEqual(
-- [d],
-- b.getchildren())
-- self.assertEqual(
-- [],
-- d.getchildren())
--
- def test_makeelement(self):
- Element = self.etree.Element
-
-@@ -2010,184 +1990,6 @@ class _ETreeTestCaseBase(HelperTestCase):
- [None] * 5,
- [el.tail for el in a.iter()])
-
-- def test_getiterator(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- b = SubElement(a, 'b')
-- c = SubElement(a, 'c')
-- d = SubElement(b, 'd')
-- e = SubElement(c, 'e')
--
-- self.assertEqual(
-- [a, b, d, c, e],
-- list(a.getiterator()))
-- self.assertEqual(
-- [d],
-- list(d.getiterator()))
--
-- def test_getiterator_empty(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- b = SubElement(a, 'b')
-- c = SubElement(a, 'c')
-- d = SubElement(b, 'd')
-- e = SubElement(c, 'e')
--
-- self.assertEqual(
-- [],
-- list(a.getiterator('none')))
-- self.assertEqual(
-- [],
-- list(e.getiterator('none')))
-- self.assertEqual(
-- [e],
-- list(e.getiterator()))
--
-- def test_getiterator_filter(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- b = SubElement(a, 'b')
-- c = SubElement(a, 'c')
-- d = SubElement(b, 'd')
-- e = SubElement(c, 'e')
--
-- self.assertEqual(
-- [a],
-- list(a.getiterator('a')))
-- a2 = SubElement(e, 'a')
-- self.assertEqual(
-- [a, a2],
-- list(a.getiterator('a')))
-- self.assertEqual(
-- [a2],
-- list(c.getiterator('a')))
--
-- def test_getiterator_filter_all(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- b = SubElement(a, 'b')
-- c = SubElement(a, 'c')
-- d = SubElement(b, 'd')
-- e = SubElement(c, 'e')
--
-- self.assertEqual(
-- [a, b, d, c, e],
-- list(a.getiterator('*')))
--
-- def test_getiterator_filter_comment(self):
-- Element = self.etree.Element
-- Comment = self.etree.Comment
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- b = SubElement(a, 'b')
-- comment_b = Comment("TEST-b")
-- b.append(comment_b)
--
-- self.assertEqual(
-- [comment_b],
-- list(a.getiterator(Comment)))
--
-- comment_a = Comment("TEST-a")
-- a.append(comment_a)
--
-- self.assertEqual(
-- [comment_b, comment_a],
-- list(a.getiterator(Comment)))
--
-- self.assertEqual(
-- [comment_b],
-- list(b.getiterator(Comment)))
--
-- def test_getiterator_filter_pi(self):
-- Element = self.etree.Element
-- PI = self.etree.ProcessingInstruction
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- b = SubElement(a, 'b')
-- pi_b = PI("TEST-b")
-- b.append(pi_b)
--
-- self.assertEqual(
-- [pi_b],
-- list(a.getiterator(PI)))
--
-- pi_a = PI("TEST-a")
-- a.append(pi_a)
--
-- self.assertEqual(
-- [pi_b, pi_a],
-- list(a.getiterator(PI)))
--
-- self.assertEqual(
-- [pi_b],
-- list(b.getiterator(PI)))
--
-- def test_getiterator_with_text(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- a.text = 'a'
-- b = SubElement(a, 'b')
-- b.text = 'b'
-- b.tail = 'b1'
-- c = SubElement(a, 'c')
-- c.text = 'c'
-- c.tail = 'c1'
-- d = SubElement(b, 'd')
-- d.text = 'd'
-- d.tail = 'd1'
-- e = SubElement(c, 'e')
-- e.text = 'e'
-- e.tail = 'e1'
--
-- self.assertEqual(
-- [a, b, d, c, e],
-- list(a.getiterator()))
-- #self.assertEqual(
-- # [d],
-- # list(d.getiterator()))
--
-- def test_getiterator_filter_with_text(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
--
-- a = Element('a')
-- a.text = 'a'
-- b = SubElement(a, 'b')
-- b.text = 'b'
-- b.tail = 'b1'
-- c = SubElement(a, 'c')
-- c.text = 'c'
-- c.tail = 'c1'
-- d = SubElement(b, 'd')
-- d.text = 'd'
-- d.tail = 'd1'
-- e = SubElement(c, 'e')
-- e.text = 'e'
-- e.tail = 'e1'
--
-- self.assertEqual(
-- [a],
-- list(a.getiterator('a')))
-- a2 = SubElement(e, 'a')
-- self.assertEqual(
-- [a, a2],
-- list(a.getiterator('a')))
-- self.assertEqual(
-- [a2],
-- list(e.getiterator('a')))
--
- def test_getslice(self):
- Element = self.etree.Element
- SubElement = self.etree.SubElement
-@@ -2710,41 +2512,6 @@ class _ETreeTestCaseBase(HelperTestCase):
- self.assertEqual('A2',
- a.tail)
-
-- def test_elementtree_getiterator(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
-- ElementTree = self.etree.ElementTree
--
-- a = Element('a')
-- b = SubElement(a, 'b')
-- c = SubElement(a, 'c')
-- d = SubElement(b, 'd')
-- e = SubElement(c, 'e')
-- t = ElementTree(element=a)
--
-- self.assertEqual(
-- [a, b, d, c, e],
-- list(t.getiterator()))
--
-- def test_elementtree_getiterator_filter(self):
-- Element = self.etree.Element
-- SubElement = self.etree.SubElement
-- ElementTree = self.etree.ElementTree
-- a = Element('a')
-- b = SubElement(a, 'b')
-- c = SubElement(a, 'c')
-- d = SubElement(b, 'd')
-- e = SubElement(c, 'e')
-- t = ElementTree(element=a)
--
-- self.assertEqual(
-- [a],
-- list(t.getiterator('a')))
-- a2 = SubElement(e, 'a')
-- self.assertEqual(
-- [a, a2],
-- list(t.getiterator('a')))
--
- def test_ns_access(self):
- ElementTree = self.etree.ElementTree
- ns = 'http://xml.infrae.com/1'
-@@ -3180,17 +2947,6 @@ class _ETreeTestCaseBase(HelperTestCase):
- 'value',
- root[0].get(attr_name))
-
-- def test_iterparse_getiterator(self):
-- iterparse = self.etree.iterparse
-- f = BytesIO('<a><b><d/></b><c/></a>')
--
-- counts = []
-- for event, elem in iterparse(f):
-- counts.append(len(list(elem.getiterator())))
-- self.assertEqual(
-- [1,2,1,4],
-- counts)
--
- def test_iterparse_move_elements(self):
- iterparse = self.etree.iterparse
- f = BytesIO('<a><b><d/></b><c/></a>')
-@@ -5119,6 +4875,8 @@ if ElementTree:
-
- @classmethod
- def setUpClass(cls):
-+ if sys.version_info >= (3, 9):
-+ return
- import warnings
- # ElementTree warns about getiterator() in recent Pythons
- warnings.filterwarnings(
-diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py
-index 3d8dee1c..56d38e75 100644
---- a/src/lxml/tests/test_etree.py
-+++ b/src/lxml/tests/test_etree.py
-@@ -674,6 +674,17 @@ class ETreeOnlyTestCase(HelperTestCase):
- parse = self.etree.parse
- self.assertRaises(TypeError, parse, 'notthere.xml', object())
-
-+ def test_iterparse_getiterator(self):
-+ iterparse = self.etree.iterparse
-+ f = BytesIO('<a><b><d/></b><c/></a>')
-+
-+ counts = []
-+ for event, elem in iterparse(f):
-+ counts.append(len(list(elem.getiterator())))
-+ self.assertEqual(
-+ [1,2,1,4],
-+ counts)
-+
- def test_iterparse_tree_comments(self):
- # ET removes comments
- iterparse = self.etree.iterparse
-@@ -3027,6 +3038,206 @@ class ETreeOnlyTestCase(HelperTestCase):
- el = etree.HTML('<hha:page-description>aa</hha:page-description>').find('.//page-description')
- self.assertEqual({'hha': None}, el.nsmap)
-
-+ def test_getchildren(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ c = SubElement(a, 'c')
-+ d = SubElement(b, 'd')
-+ e = SubElement(c, 'e')
-+ self.assertXML(
-+ _bytes('<a><b><d></d></b><c><e></e></c></a>'),
-+ a)
-+ self.assertEqual(
-+ [b, c],
-+ a.getchildren())
-+ self.assertEqual(
-+ [d],
-+ b.getchildren())
-+ self.assertEqual(
-+ [],
-+ d.getchildren())
-+
-+ def test_getiterator(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ c = SubElement(a, 'c')
-+ d = SubElement(b, 'd')
-+ e = SubElement(c, 'e')
-+
-+ self.assertEqual(
-+ [a, b, d, c, e],
-+ list(a.getiterator()))
-+ self.assertEqual(
-+ [d],
-+ list(d.getiterator()))
-+
-+ def test_getiterator_empty(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ c = SubElement(a, 'c')
-+ d = SubElement(b, 'd')
-+ e = SubElement(c, 'e')
-+
-+ self.assertEqual(
-+ [],
-+ list(a.getiterator('none')))
-+ self.assertEqual(
-+ [],
-+ list(e.getiterator('none')))
-+ self.assertEqual(
-+ [e],
-+ list(e.getiterator()))
-+
-+ def test_getiterator_filter(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ c = SubElement(a, 'c')
-+ d = SubElement(b, 'd')
-+ e = SubElement(c, 'e')
-+
-+ self.assertEqual(
-+ [a],
-+ list(a.getiterator('a')))
-+ a2 = SubElement(e, 'a')
-+ self.assertEqual(
-+ [a, a2],
-+ list(a.getiterator('a')))
-+ self.assertEqual(
-+ [a2],
-+ list(c.getiterator('a')))
-+
-+ def test_getiterator_filter_all(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ c = SubElement(a, 'c')
-+ d = SubElement(b, 'd')
-+ e = SubElement(c, 'e')
-+
-+ self.assertEqual(
-+ [a, b, d, c, e],
-+ list(a.getiterator('*')))
-+
-+ def test_getiterator_filter_comment(self):
-+ Element = self.etree.Element
-+ Comment = self.etree.Comment
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ comment_b = Comment("TEST-b")
-+ b.append(comment_b)
-+
-+ self.assertEqual(
-+ [comment_b],
-+ list(a.getiterator(Comment)))
-+
-+ comment_a = Comment("TEST-a")
-+ a.append(comment_a)
-+
-+ self.assertEqual(
-+ [comment_b, comment_a],
-+ list(a.getiterator(Comment)))
-+
-+ self.assertEqual(
-+ [comment_b],
-+ list(b.getiterator(Comment)))
-+
-+ def test_getiterator_filter_pi(self):
-+ Element = self.etree.Element
-+ PI = self.etree.ProcessingInstruction
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ pi_b = PI("TEST-b")
-+ b.append(pi_b)
-+
-+ self.assertEqual(
-+ [pi_b],
-+ list(a.getiterator(PI)))
-+
-+ pi_a = PI("TEST-a")
-+ a.append(pi_a)
-+
-+ self.assertEqual(
-+ [pi_b, pi_a],
-+ list(a.getiterator(PI)))
-+
-+ self.assertEqual(
-+ [pi_b],
-+ list(b.getiterator(PI)))
-+
-+ def test_getiterator_with_text(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ a.text = 'a'
-+ b = SubElement(a, 'b')
-+ b.text = 'b'
-+ b.tail = 'b1'
-+ c = SubElement(a, 'c')
-+ c.text = 'c'
-+ c.tail = 'c1'
-+ d = SubElement(b, 'd')
-+ d.text = 'd'
-+ d.tail = 'd1'
-+ e = SubElement(c, 'e')
-+ e.text = 'e'
-+ e.tail = 'e1'
-+
-+ self.assertEqual(
-+ [a, b, d, c, e],
-+ list(a.getiterator()))
-+ #self.assertEqual(
-+ # [d],
-+ # list(d.getiterator()))
-+
-+ def test_getiterator_filter_with_text(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+
-+ a = Element('a')
-+ a.text = 'a'
-+ b = SubElement(a, 'b')
-+ b.text = 'b'
-+ b.tail = 'b1'
-+ c = SubElement(a, 'c')
-+ c.text = 'c'
-+ c.tail = 'c1'
-+ d = SubElement(b, 'd')
-+ d.text = 'd'
-+ d.tail = 'd1'
-+ e = SubElement(c, 'e')
-+ e.text = 'e'
-+ e.tail = 'e1'
-+
-+ self.assertEqual(
-+ [a],
-+ list(a.getiterator('a')))
-+ a2 = SubElement(e, 'a')
-+ self.assertEqual(
-+ [a, a2],
-+ list(a.getiterator('a')))
-+ self.assertEqual(
-+ [a2],
-+ list(e.getiterator('a')))
-+
- def test_getiterator_filter_multiple(self):
- Element = self.etree.Element
- SubElement = self.etree.SubElement
-@@ -3203,6 +3414,41 @@ class ETreeOnlyTestCase(HelperTestCase):
- [a, b, c],
- list(a.getiterator('*')))
-
-+ def test_elementtree_getiterator(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+ ElementTree = self.etree.ElementTree
-+
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ c = SubElement(a, 'c')
-+ d = SubElement(b, 'd')
-+ e = SubElement(c, 'e')
-+ t = ElementTree(element=a)
-+
-+ self.assertEqual(
-+ [a, b, d, c, e],
-+ list(t.getiterator()))
-+
-+ def test_elementtree_getiterator_filter(self):
-+ Element = self.etree.Element
-+ SubElement = self.etree.SubElement
-+ ElementTree = self.etree.ElementTree
-+ a = Element('a')
-+ b = SubElement(a, 'b')
-+ c = SubElement(a, 'c')
-+ d = SubElement(b, 'd')
-+ e = SubElement(c, 'e')
-+ t = ElementTree(element=a)
-+
-+ self.assertEqual(
-+ [a],
-+ list(t.getiterator('a')))
-+ a2 = SubElement(e, 'a')
-+ self.assertEqual(
-+ [a, a2],
-+ list(t.getiterator('a')))
-+
- def test_elementtree_getelementpath(self):
- a = etree.Element("a")
- b = etree.SubElement(a, "b")
---
-2.26.2
-
-From 56ddb10e50eba7a6352e397f259d9497b44f658d Mon Sep 17 00:00:00 2001
-From: Stefan Behnel <stefan_ml@behnel.de>
-Date: Tue, 26 May 2020 11:30:45 +0200
-Subject: [PATCH 2/2] Fix a test after moving it to a different test module.
-
----
- src/lxml/tests/test_etree.py | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py
-index 56d38e75..105c59b8 100644
---- a/src/lxml/tests/test_etree.py
-+++ b/src/lxml/tests/test_etree.py
-@@ -3047,9 +3047,9 @@ class ETreeOnlyTestCase(HelperTestCase):
- c = SubElement(a, 'c')
- d = SubElement(b, 'd')
- e = SubElement(c, 'e')
-- self.assertXML(
-+ self.assertEqual(
- _bytes('<a><b><d></d></b><c><e></e></c></a>'),
-- a)
-+ self.etree.tostring(a, method="c14n"))
- self.assertEqual(
- [b, c],
- a.getchildren())
---
-2.26.2
-
diff --git a/dev-python/lxml/files/lxml-5.1.0-pypy.patch b/dev-python/lxml/files/lxml-5.1.0-pypy.patch
new file mode 100644
index 000000000000..7b50b9d3062c
--- /dev/null
+++ b/dev-python/lxml/files/lxml-5.1.0-pypy.patch
@@ -0,0 +1,175 @@
+diff --git a/src/lxml/tests/test_errors.py b/src/lxml/tests/test_errors.py
+index fa735c28..9337bc04 100644
+--- a/src/lxml/tests/test_errors.py
++++ b/src/lxml/tests/test_errors.py
+@@ -10,3 +10,3 @@ from lxml import etree
+
+-from .common_imports import HelperTestCase
++from .common_imports import HelperTestCase, IS_PYPY
+
+@@ -24,2 +24,3 @@ class ErrorTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_element_cyclic_gc_none(self):
+diff --git a/src/lxml/tests/test_http_io.py b/src/lxml/tests/test_http_io.py
+index 8385e393..0b259299 100644
+--- a/src/lxml/tests/test_http_io.py
++++ b/src/lxml/tests/test_http_io.py
+@@ -10,3 +10,3 @@ import gzip
+
+-from .common_imports import etree, HelperTestCase, BytesIO, _bytes
++from .common_imports import etree, HelperTestCase, BytesIO, _bytes, IS_PYPY
+ from .dummy_http_server import webserver, HTTPRequestCollector
+@@ -14,2 +14,3 @@ from .dummy_http_server import webserver, HTTPRequestCollector
+
++@unittest.skipIf(IS_PYPY, "broken on pypy")
+ class HttpIOTestCase(HelperTestCase):
+diff --git a/src/lxml/tests/test_nsclasses.py b/src/lxml/tests/test_nsclasses.py
+index 750dc1ed..adbec11c 100644
+--- a/src/lxml/tests/test_nsclasses.py
++++ b/src/lxml/tests/test_nsclasses.py
+@@ -8,3 +8,3 @@ import unittest
+
+-from .common_imports import etree, HelperTestCase, _bytes, make_doctest
++from .common_imports import etree, HelperTestCase, _bytes, make_doctest, IS_PYPY
+
+@@ -45,2 +45,3 @@ class ETreeNamespaceClassesTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_ns_classes(self):
+diff --git a/src/lxml/tests/test_objectify.py b/src/lxml/tests/test_objectify.py
+index 1c8ff47c..326c5316 100644
+--- a/src/lxml/tests/test_objectify.py
++++ b/src/lxml/tests/test_objectify.py
+@@ -10,3 +10,4 @@ import unittest
+ from .common_imports import (
+- etree, HelperTestCase, fileInTestDir, doctest, make_doctest, _bytes, _str, BytesIO
++ etree, HelperTestCase, fileInTestDir, doctest, make_doctest, _bytes, _str, BytesIO,
++ IS_PYPY
+ )
+@@ -383,2 +384,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_setattr(self):
+@@ -818,2 +820,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_build_tree(self):
+@@ -847,2 +850,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_bool(self):
+@@ -884,2 +888,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str(self):
+@@ -891,2 +896,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_intliteral(self):
+@@ -898,2 +904,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_floatliteral(self):
+@@ -905,2 +912,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_mul(self):
+@@ -917,2 +925,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_add(self):
+@@ -992,2 +1001,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr(self):
+@@ -999,2 +1009,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr_intliteral(self):
+@@ -1006,2 +1017,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr_floatliteral(self):
+@@ -1013,2 +1025,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr_mul(self):
+@@ -1025,2 +1038,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr_add(self):
+@@ -1050,2 +1064,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_int(self):
+@@ -1066,2 +1081,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_float(self):
+@@ -1082,2 +1098,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_float_precision(self):
+@@ -1101,2 +1118,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_float_precision_consistency(self):
+@@ -1187,2 +1205,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_unregistered(self):
+@@ -1349,2 +1368,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_cmp(self):
+@@ -1376,2 +1396,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_int_cmp(self):
+@@ -1398,2 +1419,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_bool_cmp(self):
+@@ -2067,2 +2089,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_registered_type_stringify(self):
+@@ -2537,2 +2560,3 @@ class ObjectifyTestCase(HelperTestCase):
+ # type-looked-up as ObjectifiedElement (no annotations)
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_int(self):
+@@ -2542,2 +2566,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_float(self):
+@@ -2547,2 +2572,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_str(self):
+@@ -2552,2 +2578,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_unicode(self):
+@@ -2557,2 +2584,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_bool(self):
+@@ -2562,2 +2590,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_none(self):
+@@ -2567,2 +2596,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_value_concatenation(self):
+@@ -2577,2 +2607,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_nested(self):
+@@ -2745,3 +2776,4 @@ def test_suite():
+ suite.addTests(doctest.DocTestSuite(objectify))
+- suite.addTests([make_doctest('../../../doc/objectify.txt')])
++ if not IS_PYPY:
++ suite.addTests([make_doctest('../../../doc/objectify.txt')])
+ return suite
diff --git a/dev-python/lxml/files/lxml-5.1.1-pypy.patch b/dev-python/lxml/files/lxml-5.1.1-pypy.patch
new file mode 100644
index 000000000000..2f6a75781fb8
--- /dev/null
+++ b/dev-python/lxml/files/lxml-5.1.1-pypy.patch
@@ -0,0 +1,162 @@
+diff --git a/src/lxml/tests/test_http_io.py b/src/lxml/tests/test_http_io.py
+index 8385e393..0b259299 100644
+--- a/src/lxml/tests/test_http_io.py
++++ b/src/lxml/tests/test_http_io.py
+@@ -10,3 +10,3 @@ import gzip
+
+-from .common_imports import etree, HelperTestCase, BytesIO, _bytes
++from .common_imports import etree, HelperTestCase, BytesIO, _bytes, IS_PYPY
+ from .dummy_http_server import webserver, HTTPRequestCollector
+@@ -14,2 +14,3 @@ from .dummy_http_server import webserver, HTTPRequestCollector
+
++@unittest.skipIf(IS_PYPY, "broken on pypy")
+ class HttpIOTestCase(HelperTestCase):
+diff --git a/src/lxml/tests/test_nsclasses.py b/src/lxml/tests/test_nsclasses.py
+index 750dc1ed..adbec11c 100644
+--- a/src/lxml/tests/test_nsclasses.py
++++ b/src/lxml/tests/test_nsclasses.py
+@@ -8,3 +8,3 @@ import unittest
+
+-from .common_imports import etree, HelperTestCase, _bytes, make_doctest
++from .common_imports import etree, HelperTestCase, _bytes, make_doctest, IS_PYPY
+
+@@ -45,2 +45,3 @@ class ETreeNamespaceClassesTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_ns_classes(self):
+diff --git a/src/lxml/tests/test_objectify.py b/src/lxml/tests/test_objectify.py
+index 1c8ff47c..326c5316 100644
+--- a/src/lxml/tests/test_objectify.py
++++ b/src/lxml/tests/test_objectify.py
+@@ -10,3 +10,4 @@ import unittest
+ from .common_imports import (
+- etree, HelperTestCase, fileInTestDir, doctest, make_doctest, _bytes, _str, BytesIO
++ etree, HelperTestCase, fileInTestDir, doctest, make_doctest, _bytes, _str, BytesIO,
++ IS_PYPY
+ )
+@@ -383,2 +384,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_setattr(self):
+@@ -818,2 +820,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_build_tree(self):
+@@ -847,2 +850,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_bool(self):
+@@ -884,2 +888,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str(self):
+@@ -891,2 +896,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_intliteral(self):
+@@ -898,2 +904,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_floatliteral(self):
+@@ -905,2 +912,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_mul(self):
+@@ -917,2 +925,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_add(self):
+@@ -992,2 +1001,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr(self):
+@@ -999,2 +1009,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr_intliteral(self):
+@@ -1006,2 +1017,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr_floatliteral(self):
+@@ -1013,2 +1025,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr_mul(self):
+@@ -1025,2 +1038,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_ustr_add(self):
+@@ -1050,2 +1064,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_int(self):
+@@ -1066,2 +1081,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_float(self):
+@@ -1082,2 +1098,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_float_precision(self):
+@@ -1101,2 +1118,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_float_precision_consistency(self):
+@@ -1187,2 +1205,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_unregistered(self):
+@@ -1349,2 +1368,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_str_cmp(self):
+@@ -1376,2 +1396,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_int_cmp(self):
+@@ -1398,2 +1419,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_type_bool_cmp(self):
+@@ -2067,2 +2089,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_registered_type_stringify(self):
+@@ -2537,2 +2560,3 @@ class ObjectifyTestCase(HelperTestCase):
+ # type-looked-up as ObjectifiedElement (no annotations)
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_int(self):
+@@ -2542,2 +2566,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_float(self):
+@@ -2547,2 +2572,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_str(self):
+@@ -2552,2 +2578,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_unicode(self):
+@@ -2557,2 +2584,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_bool(self):
+@@ -2562,2 +2590,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_none(self):
+@@ -2567,2 +2596,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_value_concatenation(self):
+@@ -2577,2 +2607,3 @@ class ObjectifyTestCase(HelperTestCase):
+
++ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_efactory_nested(self):
+@@ -2745,3 +2776,4 @@ def test_suite():
+ suite.addTests(doctest.DocTestSuite(objectify))
+- suite.addTests([make_doctest('../../../doc/objectify.txt')])
++ if not IS_PYPY:
++ suite.addTests([make_doctest('../../../doc/objectify.txt')])
+ return suite
diff --git a/dev-python/lxml/lxml-4.5.0.ebuild b/dev-python/lxml/lxml-4.5.0.ebuild
deleted file mode 100644
index d999936411b0..000000000000
--- a/dev-python/lxml/lxml-4.5.0.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
-
-inherit distutils-r1 eutils toolchain-funcs
-
-DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
-HOMEPAGE="https://lxml.de/ https://pypi.org/project/lxml/ https://github.com/lxml/lxml"
-SRC_URI="https://github.com/lxml/lxml/archive/${P}.tar.gz"
-S=${WORKDIR}/lxml-${P}
-
-LICENSE="BSD ElementTree GPL-2 PSF-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
-IUSE="doc examples +threads test"
-RESTRICT="!test? ( test )"
-
-# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
-RDEPEND="
- >=dev-libs/libxml2-2.9.5
- >=dev-libs/libxslt-1.1.28"
-DEPEND="${RDEPEND}"
-BDEPEND="
- virtual/pkgconfig
- dev-python/cython[${PYTHON_USEDEP}]
- dev-python/setuptools[${PYTHON_USEDEP}]
- test? ( dev-python/cssselect[${PYTHON_USEDEP}] )
- "
-
-DISTUTILS_IN_SOURCE_BUILD=1
-
-PATCHES=(
- "${FILESDIR}"/${PN}-3.5.0-cross-compile.patch
- "${FILESDIR}"/${PN}-4.5.0-tests-pypy.patch
-)
-
-python_prepare_all() {
- # avoid replacing PYTHONPATH in tests.
- sed -i -e '/sys\.path/d' test.py || die
-
- # don't use some random SDK on Darwin
- sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
- setupinfo.py || die
-
- distutils-r1_python_prepare_all
-}
-
-python_compile() {
- if ! python_is_python3; then
- local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
- fi
- tc-export PKG_CONFIG
- distutils-r1_python_compile
-}
-
-python_test() {
- cp -r -l src/lxml/tests "${BUILD_DIR}"/lib/lxml/ || die
- cp -r -l src/lxml/html/tests "${BUILD_DIR}"/lib/lxml/html/ || die
- ln -s "${S}"/doc "${BUILD_DIR}"/ || die
-
- "${EPYTHON}" test.py -vv --all-levels -p || die "Test ${test} fails with ${EPYTHON}"
-}
-
-python_install_all() {
- if use doc; then
- local DOCS=( README.rst *.txt doc/*.txt )
- local HTML_DOCS=( doc/html/. )
- fi
- if use examples; then
- dodoc -r samples
- fi
-
- distutils-r1_python_install_all
-}
-
-pkg_postinst() {
- optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup
- optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
-}
diff --git a/dev-python/lxml/lxml-4.5.1.ebuild b/dev-python/lxml/lxml-4.5.1.ebuild
deleted file mode 100644
index 3759600dec7c..000000000000
--- a/dev-python/lxml/lxml-4.5.1.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} pypy3 )
-
-inherit distutils-r1 eutils toolchain-funcs
-
-DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
-HOMEPAGE="https://lxml.de/ https://pypi.org/project/lxml/ https://github.com/lxml/lxml"
-SRC_URI="https://github.com/lxml/lxml/archive/${P}.tar.gz"
-S=${WORKDIR}/lxml-${P}
-
-LICENSE="BSD ElementTree GPL-2 PSF-2"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
-IUSE="doc examples +threads test"
-RESTRICT="!test? ( test )"
-
-# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
-RDEPEND="
- >=dev-libs/libxml2-2.9.5
- >=dev-libs/libxslt-1.1.28"
-DEPEND="${RDEPEND}"
-BDEPEND="
- virtual/pkgconfig
- dev-python/cython[${PYTHON_USEDEP}]
- dev-python/setuptools[${PYTHON_USEDEP}]
- test? ( dev-python/cssselect[${PYTHON_USEDEP}] )
- "
-
-DISTUTILS_IN_SOURCE_BUILD=1
-
-PATCHES=(
- "${FILESDIR}"/${PN}-4.5.0-tests-pypy.patch
- "${FILESDIR}"/lxml-4.5.1-py39.patch
-)
-
-python_prepare_all() {
- # avoid replacing PYTHONPATH in tests.
- sed -i -e '/sys\.path/d' test.py || die
-
- # don't use some random SDK on Darwin
- sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
- setupinfo.py || die
-
- distutils-r1_python_prepare_all
-}
-
-python_compile() {
- if ! python_is_python3; then
- local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
- fi
- tc-export PKG_CONFIG
- distutils-r1_python_compile
-}
-
-python_test() {
- cp -r -l src/lxml/tests "${BUILD_DIR}"/lib/lxml/ || die
- cp -r -l src/lxml/html/tests "${BUILD_DIR}"/lib/lxml/html/ || die
- ln -s "${S}"/doc "${BUILD_DIR}"/ || die
-
- "${EPYTHON}" test.py -vv --all-levels -p || die "Test ${test} fails with ${EPYTHON}"
-}
-
-python_install_all() {
- if use doc; then
- local DOCS=( README.rst *.txt doc/*.txt )
- local HTML_DOCS=( doc/html/. )
- fi
- if use examples; then
- dodoc -r samples
- fi
-
- distutils-r1_python_install_all
-}
-
-pkg_postinst() {
- optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup
- optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
-}
diff --git a/dev-python/lxml/lxml-4.5.2.ebuild b/dev-python/lxml/lxml-4.5.2.ebuild
deleted file mode 100644
index 13ca5bc33f3f..000000000000
--- a/dev-python/lxml/lxml-4.5.2.ebuild
+++ /dev/null
@@ -1,81 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} pypy3 )
-
-inherit distutils-r1 eutils toolchain-funcs
-
-DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
-HOMEPAGE="https://lxml.de/ https://pypi.org/project/lxml/ https://github.com/lxml/lxml"
-SRC_URI="https://github.com/lxml/lxml/archive/${P}.tar.gz"
-S=${WORKDIR}/lxml-${P}
-
-LICENSE="BSD ElementTree GPL-2 PSF-2"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
-IUSE="doc examples +threads test"
-RESTRICT="!test? ( test )"
-
-# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
-RDEPEND="
- >=dev-libs/libxml2-2.9.5
- >=dev-libs/libxslt-1.1.28"
-DEPEND="${RDEPEND}"
-BDEPEND="
- virtual/pkgconfig
- dev-python/cython[${PYTHON_USEDEP}]
- dev-python/setuptools[${PYTHON_USEDEP}]
- test? ( dev-python/cssselect[${PYTHON_USEDEP}] )
- "
-
-DISTUTILS_IN_SOURCE_BUILD=1
-
-PATCHES=(
- "${FILESDIR}"/${PN}-4.5.0-tests-pypy.patch
-)
-
-python_prepare_all() {
- # avoid replacing PYTHONPATH in tests.
- sed -i -e '/sys\.path/d' test.py || die
-
- # don't use some random SDK on Darwin
- sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
- setupinfo.py || die
-
- distutils-r1_python_prepare_all
-}
-
-python_compile() {
- if ! python_is_python3; then
- local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
- fi
- tc-export PKG_CONFIG
- distutils-r1_python_compile
-}
-
-python_test() {
- cp -r -l src/lxml/tests "${BUILD_DIR}"/lib/lxml/ || die
- cp -r -l src/lxml/html/tests "${BUILD_DIR}"/lib/lxml/html/ || die
- ln -s "${S}"/doc "${BUILD_DIR}"/ || die
-
- "${EPYTHON}" test.py -vv --all-levels -p || die "Test ${test} fails with ${EPYTHON}"
-}
-
-python_install_all() {
- if use doc; then
- local DOCS=( README.rst *.txt doc/*.txt )
- local HTML_DOCS=( doc/html/. )
- fi
- if use examples; then
- dodoc -r samples
- fi
-
- distutils-r1_python_install_all
-}
-
-pkg_postinst() {
- optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup
- optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
-}
diff --git a/dev-python/lxml/lxml-5.1.0.ebuild b/dev-python/lxml/lxml-5.1.0.ebuild
new file mode 100644
index 000000000000..09f1667e8875
--- /dev/null
+++ b/dev-python/lxml/lxml-5.1.0.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+
+inherit distutils-r1 optfeature toolchain-funcs
+
+DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
+HOMEPAGE="
+ https://lxml.de/
+ https://pypi.org/project/lxml/
+ https://github.com/lxml/lxml/
+"
+SRC_URI="
+ https://github.com/lxml/lxml/archive/${P}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+S=${WORKDIR}/lxml-${P}
+
+LICENSE="BSD ElementTree GPL-2 PSF-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="doc examples +threads test"
+RESTRICT="!test? ( test )"
+
+# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
+DEPEND="
+ >=dev-libs/libxml2-2.10.3
+ >=dev-libs/libxslt-1.1.38
+"
+RDEPEND="
+ ${DEPEND}
+"
+BDEPEND="
+ virtual/pkgconfig
+ >=dev-python/cython-3.0.7[${PYTHON_USEDEP}]
+ doc? (
+ $(python_gen_any_dep '
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+ ')
+ )
+ test? (
+ dev-python/cssselect[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-pypy.patch"
+)
+
+python_check_deps() {
+ use doc || return 0
+ python_has_version -b "dev-python/docutils[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/pygments[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]"
+}
+
+python_prepare_all() {
+ # avoid replacing PYTHONPATH in tests.
+ sed -i -e '/sys\.path/d' test.py || die
+
+ # don't use some random SDK on Darwin
+ sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
+ setupinfo.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ local DISTUTILS_ARGS=(
+ # by default it adds -w to CFLAGS
+ --warnings
+ )
+ tc-export PKG_CONFIG
+ distutils-r1_python_compile
+}
+
+python_compile_all() {
+ use doc && emake html
+}
+
+python_test() {
+ local dir=${BUILD_DIR}/test$(python_get_sitedir)/lxml
+ local -x PATH=${BUILD_DIR}/test/usr/bin:${PATH}
+
+ cp -al "${BUILD_DIR}"/{install,test} || die
+ cp -al src/lxml/tests "${dir}/" || die
+ cp -al src/lxml/html/tests "${dir}/html/" || die
+ ln -rs "${S}"/doc "${dir}"/../../ || die
+
+ "${EPYTHON}" test.py -vv --all-levels -p || die "Test ${test} fails with ${EPYTHON}"
+}
+
+python_install_all() {
+ if use doc; then
+ local DOCS=( README.rst *.txt doc/*.txt )
+ local HTML_DOCS=( doc/html/. )
+ fi
+ if use examples; then
+ dodoc -r samples
+ fi
+
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup4
+ optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
+}
diff --git a/dev-python/lxml/lxml-5.1.1.ebuild b/dev-python/lxml/lxml-5.1.1.ebuild
new file mode 100644
index 000000000000..adc0126c2821
--- /dev/null
+++ b/dev-python/lxml/lxml-5.1.1.ebuild
@@ -0,0 +1,117 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+
+inherit distutils-r1 optfeature toolchain-funcs
+
+DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
+HOMEPAGE="
+ https://lxml.de/
+ https://pypi.org/project/lxml/
+ https://github.com/lxml/lxml/
+"
+SRC_URI="
+ https://github.com/lxml/lxml/archive/${P}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+S=${WORKDIR}/lxml-${P}
+
+LICENSE="BSD ElementTree GPL-2 PSF-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="doc examples +threads test"
+RESTRICT="!test? ( test )"
+
+# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
+DEPEND="
+ >=dev-libs/libxml2-2.10.3
+ >=dev-libs/libxslt-1.1.38
+"
+RDEPEND="
+ ${DEPEND}
+"
+BDEPEND="
+ virtual/pkgconfig
+ >=dev-python/cython-3.0.9[${PYTHON_USEDEP}]
+ doc? (
+ $(python_gen_any_dep '
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+ ')
+ )
+ test? (
+ dev-python/cssselect[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.1.1-pypy.patch"
+)
+
+python_check_deps() {
+ use doc || return 0
+ python_has_version -b "dev-python/docutils[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/pygments[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]"
+}
+
+python_prepare_all() {
+ # avoid replacing PYTHONPATH in tests.
+ sed -i -e '/sys\.path/d' test.py || die
+
+ # don't use some random SDK on Darwin
+ sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
+ setupinfo.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ local DISTUTILS_ARGS=(
+ # by default it adds -w to CFLAGS
+ --warnings
+ )
+ tc-export PKG_CONFIG
+ distutils-r1_python_compile
+}
+
+python_compile_all() {
+ use doc && emake html
+}
+
+python_test() {
+ local dir=${BUILD_DIR}/test$(python_get_sitedir)/lxml
+ local -x PATH=${BUILD_DIR}/test/usr/bin:${PATH}
+
+ cp -al "${BUILD_DIR}"/{install,test} || die
+ cp -al src/lxml/tests "${dir}/" || die
+ cp -al src/lxml/html/tests "${dir}/html/" || die
+ ln -rs "${S}"/doc "${dir}"/../../ || die
+
+ "${EPYTHON}" test.py -vv --all-levels -p || die "Test ${test} fails with ${EPYTHON}"
+}
+
+python_install_all() {
+ if use doc; then
+ local DOCS=( README.rst *.txt doc/*.txt )
+ local HTML_DOCS=( doc/html/. )
+ fi
+ if use examples; then
+ dodoc -r samples
+ fi
+
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup4
+ optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
+}
diff --git a/dev-python/lxml/lxml-5.2.0.ebuild b/dev-python/lxml/lxml-5.2.0.ebuild
new file mode 100644
index 000000000000..9153f366839c
--- /dev/null
+++ b/dev-python/lxml/lxml-5.2.0.ebuild
@@ -0,0 +1,128 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+
+inherit distutils-r1 optfeature toolchain-funcs
+
+DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
+HOMEPAGE="
+ https://lxml.de/
+ https://pypi.org/project/lxml/
+ https://github.com/lxml/lxml/
+"
+SRC_URI="
+ https://github.com/lxml/lxml/archive/${P}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+S=${WORKDIR}/lxml-${P}
+
+LICENSE="BSD ElementTree GPL-2 PSF-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="doc examples +threads test"
+RESTRICT="!test? ( test )"
+
+# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
+DEPEND="
+ >=dev-libs/libxml2-2.10.3
+ >=dev-libs/libxslt-1.1.38
+"
+RDEPEND="
+ ${DEPEND}
+"
+BDEPEND="
+ virtual/pkgconfig
+ >=dev-python/cython-3.0.10[${PYTHON_USEDEP}]
+ doc? (
+ $(python_gen_any_dep '
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+ ')
+ )
+ test? (
+ dev-python/cssselect[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.1.1-pypy.patch"
+)
+
+python_check_deps() {
+ use doc || return 0
+ python_has_version -b "dev-python/docutils[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/pygments[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]"
+}
+
+python_prepare_all() {
+ # avoid replacing PYTHONPATH in tests.
+ sed -i -e '/sys\.path/d' test.py || die
+
+ # don't use some random SDK on Darwin
+ sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
+ setupinfo.py || die
+
+ # don't depend on sys-apps/which
+ sed -i -e 's:which:command -v:' Makefile || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ local DISTUTILS_ARGS=(
+ # by default it adds -w to CFLAGS
+ --warnings
+ )
+ tc-export PKG_CONFIG
+ distutils-r1_python_compile
+}
+
+python_compile_all() {
+ use doc && emake html
+}
+
+python_test() {
+ local dir=${BUILD_DIR}/test$(python_get_sitedir)/lxml
+ local -x PATH=${BUILD_DIR}/test/usr/bin:${PATH}
+
+ cp -al "${BUILD_DIR}"/{install,test} || die
+ cp -al src/lxml/tests "${dir}/" || die
+ cp -al src/lxml/html/tests "${dir}/html/" || die
+ ln -rs "${S}"/doc "${dir}"/../../ || die
+
+ # test_feedparser_data requires lxml_html_clean
+ # this is the *simplest* way of skipping these without breaking
+ # random other tests, sigh
+ sed -e '/lxml\.html\.clean/d' \
+ -i "${dir}"/html/tests/test_feedparser_data.py || die
+ rm -r "${dir}"/html/tests/*-data/*.data || die
+
+ "${EPYTHON}" test.py -vv --all-levels -p ||
+ die "Tests fail on ${EPYTHON}"
+}
+
+python_install_all() {
+ if use doc; then
+ local DOCS=( README.rst *.txt doc/*.txt )
+ local HTML_DOCS=( doc/html/. )
+ fi
+ if use examples; then
+ dodoc -r samples
+ fi
+
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup4
+ optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
+}
diff --git a/dev-python/lxml/lxml-5.2.1.ebuild b/dev-python/lxml/lxml-5.2.1.ebuild
new file mode 100644
index 000000000000..48345b052c05
--- /dev/null
+++ b/dev-python/lxml/lxml-5.2.1.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} pypy3 )
+
+inherit distutils-r1 optfeature toolchain-funcs
+
+DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
+HOMEPAGE="
+ https://lxml.de/
+ https://pypi.org/project/lxml/
+ https://github.com/lxml/lxml/
+"
+SRC_URI="
+ https://github.com/lxml/lxml/archive/${P}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+S=${WORKDIR}/lxml-${P}
+
+LICENSE="BSD ElementTree GPL-2 PSF-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="doc examples +threads test"
+RESTRICT="!test? ( test )"
+
+# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
+DEPEND="
+ >=dev-libs/libxml2-2.10.3
+ >=dev-libs/libxslt-1.1.38
+"
+RDEPEND="
+ ${DEPEND}
+"
+BDEPEND="
+ virtual/pkgconfig
+ >=dev-python/cython-3.0.10[${PYTHON_USEDEP}]
+ doc? (
+ $(python_gen_any_dep '
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+ ')
+ )
+ test? (
+ dev-python/cssselect[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.1.1-pypy.patch"
+)
+
+python_check_deps() {
+ use doc || return 0
+ python_has_version -b "dev-python/docutils[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/pygments[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]"
+}
+
+python_prepare_all() {
+ # avoid replacing PYTHONPATH in tests.
+ sed -i -e '/sys\.path/d' test.py || die
+
+ # don't use some random SDK on Darwin
+ sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
+ setupinfo.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ local DISTUTILS_ARGS=(
+ # by default it adds -w to CFLAGS
+ --warnings
+ )
+ tc-export PKG_CONFIG
+ distutils-r1_python_compile
+}
+
+python_compile_all() {
+ use doc && emake html
+}
+
+python_test() {
+ local dir=${BUILD_DIR}/test$(python_get_sitedir)/lxml
+ local -x PATH=${BUILD_DIR}/test/usr/bin:${PATH}
+
+ cp -al "${BUILD_DIR}"/{install,test} || die
+ cp -al src/lxml/tests "${dir}/" || die
+ cp -al src/lxml/html/tests "${dir}/html/" || die
+ ln -rs "${S}"/doc "${dir}"/../../ || die
+
+ # test_feedparser_data requires lxml_html_clean
+ # this is the *simplest* way of skipping these without breaking
+ # random other tests, sigh
+ sed -e '/lxml\.html\.clean/d' \
+ -i "${dir}"/html/tests/test_feedparser_data.py || die
+ rm -r "${dir}"/html/tests/*-data/*.data || die
+
+ "${EPYTHON}" test.py -vv --all-levels -p ||
+ die "Tests fail on ${EPYTHON}"
+}
+
+python_install_all() {
+ if use doc; then
+ local DOCS=( README.rst *.txt doc/*.txt )
+ local HTML_DOCS=( doc/html/. )
+ fi
+ if use examples; then
+ dodoc -r samples
+ fi
+
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup4
+ optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
+ optfeature "Support for lxml.html.clean sanitizer" dev-python/lxml-html-clean
+}
diff --git a/dev-python/lxml/lxml-5.2.2.ebuild b/dev-python/lxml/lxml-5.2.2.ebuild
new file mode 100644
index 000000000000..f364a0ea6f6b
--- /dev/null
+++ b/dev-python/lxml/lxml-5.2.2.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} pypy3 )
+
+inherit distutils-r1 optfeature toolchain-funcs
+
+DESCRIPTION="A Pythonic binding for the libxml2 and libxslt libraries"
+HOMEPAGE="
+ https://lxml.de/
+ https://pypi.org/project/lxml/
+ https://github.com/lxml/lxml/
+"
+SRC_URI="
+ https://github.com/lxml/lxml/archive/${P}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+S=${WORKDIR}/lxml-${P}
+
+LICENSE="BSD ElementTree GPL-2 PSF-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="doc examples +threads test"
+RESTRICT="!test? ( test )"
+
+# Note: lib{xml2,xslt} are used as C libraries, not Python modules.
+DEPEND="
+ >=dev-libs/libxml2-2.10.3
+ >=dev-libs/libxslt-1.1.38
+"
+RDEPEND="
+ ${DEPEND}
+"
+BDEPEND="
+ virtual/pkgconfig
+ >=dev-python/cython-3.0.10[${PYTHON_USEDEP}]
+ doc? (
+ $(python_gen_any_dep '
+ dev-python/docutils[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+ dev-python/sphinx[${PYTHON_USEDEP}]
+ dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]
+ ')
+ )
+ test? (
+ dev-python/cssselect[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-5.1.1-pypy.patch"
+)
+
+python_check_deps() {
+ use doc || return 0
+ python_has_version -b "dev-python/docutils[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/pygments[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx[${PYTHON_USEDEP}]" &&
+ python_has_version -b "dev-python/sphinx-rtd-theme[${PYTHON_USEDEP}]"
+}
+
+python_prepare_all() {
+ # avoid replacing PYTHONPATH in tests.
+ sed -i -e '/sys\.path/d' test.py || die
+
+ # don't use some random SDK on Darwin
+ sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \
+ setupinfo.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile() {
+ local DISTUTILS_ARGS=(
+ # by default it adds -w to CFLAGS
+ --warnings
+ )
+ tc-export PKG_CONFIG
+ distutils-r1_python_compile
+}
+
+python_compile_all() {
+ use doc && emake html
+}
+
+python_test() {
+ local dir=${BUILD_DIR}/test$(python_get_sitedir)/lxml
+ local -x PATH=${BUILD_DIR}/test/usr/bin:${PATH}
+
+ cp -al "${BUILD_DIR}"/{install,test} || die
+ cp -al src/lxml/tests "${dir}/" || die
+ cp -al src/lxml/html/tests "${dir}/html/" || die
+ ln -rs "${S}"/doc "${dir}"/../../ || die
+
+ "${EPYTHON}" test.py -vv --all-levels -p ||
+ die "Tests fail on ${EPYTHON}"
+}
+
+python_install_all() {
+ if use doc; then
+ local DOCS=( README.rst *.txt doc/*.txt )
+ local HTML_DOCS=( doc/html/. )
+ fi
+ if use examples; then
+ dodoc -r samples
+ fi
+
+ distutils-r1_python_install_all
+}
+
+pkg_postinst() {
+ optfeature "Support for BeautifulSoup as a parser backend" dev-python/beautifulsoup4
+ optfeature "Translates CSS selectors to XPath 1.0 expressions" dev-python/cssselect
+ optfeature "Support for lxml.html.clean sanitizer" dev-python/lxml-html-clean
+}
diff --git a/dev-python/lxml/metadata.xml b/dev-python/lxml/metadata.xml
index ed72c69d7530..f7dc349c9fdb 100644
--- a/dev-python/lxml/metadata.xml
+++ b/dev-python/lxml/metadata.xml
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <maintainer type="project">
- <email>python@gentoo.org</email>
- <name>Python</name>
- </maintainer>
- <upstream>
- <remote-id type="pypi">lxml</remote-id>
- </upstream>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:lxml:lxml</remote-id>
+ <remote-id type="pypi">lxml</remote-id>
+ <remote-id type="github">lxml/lxml</remote-id>
+ <bugs-to>https://bugs.launchpad.net/lxml</bugs-to>
+ </upstream>
</pkgmetadata>