dev-python/lxml: Sync with Gentoo

It's from Gentoo commit 9ba9b5bdbf71382e65cf02637529704a8fd75757.
This commit is contained in:
Flatcar Buildbot 2024-04-08 07:13:02 +00:00 committed by Krzesimir Nowak
parent 71dcff1e02
commit 866cc308c5
7 changed files with 195 additions and 137 deletions

View File

@ -1,6 +1,4 @@
DIST lxml-4.9.3-patches-2.tar.xz 24288 BLAKE2B 47b7c486a1c1616c875111bd53b14d4211a1eee3f412985f4022e71b85b087abd71d36919fb025257f17de404329284898ddc639f85e8b15ade21778fa218d98 SHA512 713172b4c907db6479a0a803a842824825b212a9b645c1ca356f793658bd6c63113ea248278e7c46b512e22e3130696e9fc5127fea82a67372d920733fc160b0
DIST lxml-4.9.3.gh.tar.gz 958628 BLAKE2B ffdf3fe781a03815f7c026229d313721c93375ebafad9b4a20c5d8a380a631401e546d8701a94d8c49615fb6a71e84940d8ca0299b47a37c1c9596db36659113 SHA512 903bd4935c7708b459aee9befcf3f6e3e3aaa9adc122591ea923b6e3d8fd288f07cab3f5f0edb08e3bf9db80414324f0a1a8e5a5089f9cda82f6c50f5df59423
DIST lxml-4.9.4.gh.tar.gz 960009 BLAKE2B 7d31095dcf1f73c1026e7378e6adb19a053edc116b119ae415c3324134d3700822bf4611dc3cbf7c216d396e1404b143c8ebfdfb7e5a71b9ef6ec187898cc699 SHA512 528ef4ae057a7ee54d3193a042a6db500ada883d1d506829b6824d91ec979feb69ec79239420112eae0e08a437b2e5da8efc35feb5d04d119bfae2679e918d29
DIST lxml-5.0.0.gh.tar.gz 964278 BLAKE2B 9c3f026b03bd671545cb039632af9bf1e8b94b8f8d4a20d0e4110f2b2d63cf0a46f983d0fa8eb71867ba9ac8cd46c949714dc7486faf01ecedae858e39799031 SHA512 6562bb68ea677fd9726adff1940034e364be0626dd1c086971cf0b271ca5caf98c96a3c465b98ede76f72248a40cf190fdc4f54c04c7e9c93e6408fde63fbfd3
DIST lxml-5.0.1.gh.tar.gz 965422 BLAKE2B 4dfc17a0d3920a6785765f7bf5a35b578c8e62419ce6b5288a2899fcbf8b809a235a9b3b23abbcfa84ba5fcabb9ce7a838ff02f3f74e4ae5cb60850b951e3c23 SHA512 09ed4d9fd1396a0fbc2d7b14119545817497a85e632fde6239f6e66921926476e468a9ced227b6575519a2d1a5d03c858319386a5d739ff7aa3f68282d027b63
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

View File

@ -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

View File

@ -1,118 +0,0 @@
# 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-2.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=(
"${WORKDIR}"/${PN}-4.9.3-patches-2
)
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
}

View File

@ -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 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
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 )"

View File

@ -18,7 +18,6 @@ HOMEPAGE="
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-2.tar.xz
"
S=${WORKDIR}/lxml-${P}
@ -38,7 +37,7 @@ RDEPEND="
"
BDEPEND="
virtual/pkgconfig
>=dev-python/cython-3.0.7[${PYTHON_USEDEP}]
>=dev-python/cython-3.0.9[${PYTHON_USEDEP}]
doc? (
$(python_gen_any_dep '
dev-python/docutils[${PYTHON_USEDEP}]
@ -53,7 +52,7 @@ BDEPEND="
"
PATCHES=(
"${WORKDIR}"/${PN}-4.9.3-patches-2/0001-Skip-tests-failing-on-PyPy.patch
"${FILESDIR}/${PN}-5.1.1-pypy.patch"
)
python_check_deps() {

View File

@ -18,13 +18,12 @@ HOMEPAGE="
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-2.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"
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 )"
@ -38,7 +37,7 @@ RDEPEND="
"
BDEPEND="
virtual/pkgconfig
>=dev-python/cython-0.29.35[${PYTHON_USEDEP}]
>=dev-python/cython-3.0.10[${PYTHON_USEDEP}]
doc? (
$(python_gen_any_dep '
dev-python/docutils[${PYTHON_USEDEP}]
@ -53,7 +52,7 @@ BDEPEND="
"
PATCHES=(
"${WORKDIR}"/${PN}-4.9.3-patches-2
"${FILESDIR}/${PN}-5.1.1-pypy.patch"
)
python_check_deps() {
@ -72,6 +71,9 @@ python_prepare_all() {
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
}
@ -97,7 +99,15 @@ python_test() {
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}"
# 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() {

View File

@ -1,4 +1,4 @@
# Copyright 1999-2023 Gentoo Authors
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -18,7 +18,6 @@ HOMEPAGE="
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-2.tar.xz
"
S=${WORKDIR}/lxml-${P}
@ -38,7 +37,7 @@ RDEPEND="
"
BDEPEND="
virtual/pkgconfig
>=dev-python/cython-3.0.7[${PYTHON_USEDEP}]
>=dev-python/cython-3.0.10[${PYTHON_USEDEP}]
doc? (
$(python_gen_any_dep '
dev-python/docutils[${PYTHON_USEDEP}]
@ -53,7 +52,7 @@ BDEPEND="
"
PATCHES=(
"${WORKDIR}"/${PN}-4.9.3-patches-2/0001-Skip-tests-failing-on-PyPy.patch
"${FILESDIR}/${PN}-5.1.1-pypy.patch"
)
python_check_deps() {
@ -97,7 +96,15 @@ python_test() {
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}"
# 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() {