From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/lxml/, dev-python/lxml/files/
Date: Thu, 27 Jul 2023 04:24:45 +0000 (UTC) [thread overview]
Message-ID: <1690431871.07f48c319ee7a5ebedbe615682f702c6ac99bbc9.sam@gentoo> (raw)
commit: 07f48c319ee7a5ebedbe615682f702c6ac99bbc9
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 27 04:24:12 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jul 27 04:24:31 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07f48c31
dev-python/lxml: backport cython-3 fixes and test fixes for newer libxml2
Closes: https://bugs.gentoo.org/898682
Closes: https://bugs.gentoo.org/905643
Closes: https://bugs.gentoo.org/906088
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-python/lxml/Manifest | 1 +
.../files/lxml-4.9.3-tests-py3.11-cython3.patch | 10 ++
dev-python/lxml/lxml-4.9.3-r1.ebuild | 116 +++++++++++++++++++++
3 files changed, 127 insertions(+)
diff --git a/dev-python/lxml/Manifest b/dev-python/lxml/Manifest
index 5b7a6edd4e46..3a2715be6ff9 100644
--- a/dev-python/lxml/Manifest
+++ b/dev-python/lxml/Manifest
@@ -1,2 +1,3 @@
DIST lxml-4.9.2.gh.tar.gz 957365 BLAKE2B 201b3977da90386e413f1b89a4b7ee1e44d6bbea05e622e92feb1d67c637ce46ebf746f0648f034ed3bccd609233ccf7d8a7ee456f13b8d9ca8587ddf1ebd32a SHA512 816b2fe2eef2a97a0df66cbc39850c6dc3d6470e4033cc73edb40c80c0afbbe6c084d042d7c98b29497926e76f648caa42e1ebe5d83060af08af6972316077b0
+DIST lxml-4.9.3-patches.tar.xz 10544 BLAKE2B 407938d2f701400e919110c3bfe84e94621f39f8178850c466d41549ee0eff4f23e93cdd8ea684713e8276acfaa05d6f7b7af4d375c859b9fc5b2981d60983a3 SHA512 c2d5d2ffb035aed6d846de84885b87142b2be7a09ffe6927e7c032acab343730acfcbefd75e8141cf3b41b308c532869a7878b515f3d4eeefa7526a3d2599398
DIST lxml-4.9.3.gh.tar.gz 958628 BLAKE2B ffdf3fe781a03815f7c026229d313721c93375ebafad9b4a20c5d8a380a631401e546d8701a94d8c49615fb6a71e84940d8ca0299b47a37c1c9596db36659113 SHA512 903bd4935c7708b459aee9befcf3f6e3e3aaa9adc122591ea923b6e3d8fd288f07cab3f5f0edb08e3bf9db80414324f0a1a8e5a5089f9cda82f6c50f5df59423
diff --git a/dev-python/lxml/files/lxml-4.9.3-tests-py3.11-cython3.patch b/dev-python/lxml/files/lxml-4.9.3-tests-py3.11-cython3.patch
new file mode 100644
index 000000000000..1fb466ab810f
--- /dev/null
+++ b/dev-python/lxml/files/lxml-4.9.3-tests-py3.11-cython3.patch
@@ -0,0 +1,10 @@
+--- a/src/lxml/tests/test_errors.py
++++ b/src/lxml/tests/test_errors.py
+@@ -25,6 +25,7 @@ class ErrorTestCase(HelperTestCase):
+ def test_empty_parse(self):
+ self.assertRaises(etree.XMLSyntaxError, etree.fromstring, '')
+
++ @unittest.skipIf(sys.version_info >= (3, 11), "Known GC failure (https://bugzilla.redhat.com/show_bug.cgi?id=2051510)")
+ @unittest.skipIf(IS_PYPY, "broken on pypy")
+ def test_element_cyclic_gc_none(self):
+ # test if cyclic reference can crash etree
diff --git a/dev-python/lxml/lxml-4.9.3-r1.ebuild b/dev-python/lxml/lxml-4.9.3-r1.ebuild
new file mode 100644
index 000000000000..0ec56e19ad13
--- /dev/null
+++ b/dev-python/lxml/lxml-4.9.3-r1.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2023 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
+ https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-4.9.3-patches.tar.xz
+"
+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-0.29.35[${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}-4.9.3-tests-pypy.patch
+ "${FILESDIR}"/${PN}-4.9.3-tests-py3.11-cython3.patch
+ "${WORKDIR}"/${PN}-4.9.3-patches
+)
+
+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() {
+ 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
+}
next reply other threads:[~2023-07-27 4:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 4:24 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-08-27 16:13 [gentoo-commits] repo/gentoo:master commit in: dev-python/lxml/, dev-python/lxml/files/ Michał Górny
2021-12-13 8:35 Michał Górny
2021-10-29 15:12 Sam James
2020-05-26 10:35 Michał Górny
2020-01-30 5:54 Michał Górny
2019-01-07 20:44 Virgil Dupras
2016-10-14 21:30 David Seifert
2015-11-13 13:20 Justin Lecher
2015-09-25 7:11 Justin Lecher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1690431871.07f48c319ee7a5ebedbe615682f702c6ac99bbc9.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox