From c42521030bdc537ce21bba94efa0d8e2f6b6114d Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 5 Jun 2023 07:12:27 +0000 Subject: [PATCH] dev-python/lxml: Sync with Gentoo It's from Gentoo commit 77f67752cd0fa1d306b5d82723954ac8dbc6cd6c. --- ...xml-4.9.2-py3.12-drop-deprecated-imp.patch | 49 +++++++++++++++++++ .../dev-python/lxml/lxml-4.9.2.ebuild | 6 ++- 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 sdk_container/src/third_party/portage-stable/dev-python/lxml/files/lxml-4.9.2-py3.12-drop-deprecated-imp.patch diff --git a/sdk_container/src/third_party/portage-stable/dev-python/lxml/files/lxml-4.9.2-py3.12-drop-deprecated-imp.patch b/sdk_container/src/third_party/portage-stable/dev-python/lxml/files/lxml-4.9.2-py3.12-drop-deprecated-imp.patch new file mode 100644 index 0000000000..a59a60e748 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-python/lxml/files/lxml-4.9.2-py3.12-drop-deprecated-imp.patch @@ -0,0 +1,49 @@ +https://github.com/lxml/lxml/commit/07db761f9f027d1814a43686cda6fca26e37a931 +https://github.com/lxml/lxml/commit/c6b7e621e4696c02bf8f6ea423ffbbf2109748ab + +From 07db761f9f027d1814a43686cda6fca26e37a931 Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Thu, 11 May 2023 10:29:02 +0200 +Subject: [PATCH] Avoid using the deprecated "imp" module. + +Closes https://bugs.launchpad.net/lxml/+bug/2018137 +--- a/src/lxml/html/tests/test_html5parser.py ++++ b/src/lxml/html/tests/test_html5parser.py +@@ -1,5 +1,4 @@ + import os +-import imp + try: + from StringIO import StringIO + except ImportError: # python 3 +@@ -45,7 +44,10 @@ def find_module(self, fullname, path=None): + return None + + def load_module(self, fullname): +- mod = sys.modules.setdefault(fullname, imp.new_module(fullname)) ++ fake_module = object() ++ fake_module.__qualname__ = fullname ++ fake_module.__name__ = fullname.rsplit('.', 1)[-1] ++ mod = sys.modules.setdefault(fullname, fake_module) + mod.__file__, mod.__loader__, mod.__path__ = "", self, [] + mod.__dict__.update(self.mocks[fullname]) + return mod + +From c6b7e621e4696c02bf8f6ea423ffbbf2109748ab Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Thu, 11 May 2023 10:30:15 +0200 +Subject: [PATCH] Avoid using the deprecated "imp" module. + +Closes https://bugs.launchpad.net/lxml/+bug/2018137 +--- a/src/lxml/html/tests/test_html5parser.py ++++ b/src/lxml/html/tests/test_html5parser.py +@@ -44,7 +44,8 @@ def find_module(self, fullname, path=None): + return None + + def load_module(self, fullname): +- fake_module = object() ++ class Cls: pass ++ fake_module = Cls() + fake_module.__qualname__ = fullname + fake_module.__name__ = fullname.rsplit('.', 1)[-1] + mod = sys.modules.setdefault(fullname, fake_module) + diff --git a/sdk_container/src/third_party/portage-stable/dev-python/lxml/lxml-4.9.2.ebuild b/sdk_container/src/third_party/portage-stable/dev-python/lxml/lxml-4.9.2.ebuild index 6d7db74809..113c02e07b 100644 --- a/sdk_container/src/third_party/portage-stable/dev-python/lxml/lxml-4.9.2.ebuild +++ b/sdk_container/src/third_party/portage-stable/dev-python/lxml/lxml-4.9.2.ebuild @@ -5,7 +5,7 @@ EAPI=8 DISTUTILS_EXT=1 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9..11} pypy3 ) +PYTHON_COMPAT=( python3_{10..12} pypy3 ) inherit distutils-r1 optfeature toolchain-funcs @@ -23,7 +23,7 @@ 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 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris" IUSE="doc examples +threads test" RESTRICT="!test? ( test )" @@ -37,6 +37,7 @@ RDEPEND=" " BDEPEND=" virtual/pkgconfig + =dev-python/cython-0.29.29[${PYTHON_USEDEP}] doc? ( $(python_gen_any_dep ' @@ -53,6 +54,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}"/${PN}-4.6.0-tests-pypy.patch + "${FILESDIR}"/${P}-py3.12-drop-deprecated-imp.patch ) python_check_deps() {