commit
7925af1030
@ -0,0 +1 @@
|
|||||||
|
SOURCES/lxml-5.2.1-no-isoschematron-rng.tar.gz
|
@ -0,0 +1 @@
|
|||||||
|
f2f98b02943baf31850f083b175c95fc3b242602 SOURCES/lxml-5.2.1-no-isoschematron-rng.tar.gz
|
@ -0,0 +1,40 @@
|
|||||||
|
From f5f64df808b35969794ba3ea8c19079276aa0cb0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lumir Balhar <lbalhar@redhat.com>
|
||||||
|
Date: Thu, 4 Apr 2024 11:11:38 +0200
|
||||||
|
Subject: [PATCH] Skip test_feedparser_data if lxml_html_clean is not available
|
||||||
|
|
||||||
|
This is useful mostly for distributors shipping lxml without
|
||||||
|
lxml_html_clean.
|
||||||
|
---
|
||||||
|
src/lxml/html/tests/test_feedparser_data.py | 11 ++++++++++-
|
||||||
|
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/lxml/html/tests/test_feedparser_data.py b/src/lxml/html/tests/test_feedparser_data.py
|
||||||
|
index 36fba1acb..264c0d4b5 100644
|
||||||
|
--- a/src/lxml/html/tests/test_feedparser_data.py
|
||||||
|
+++ b/src/lxml/html/tests/test_feedparser_data.py
|
||||||
|
@@ -9,7 +9,11 @@
|
||||||
|
from lxml.tests.common_imports import doctest
|
||||||
|
from lxml.doctestcompare import LHTMLOutputChecker
|
||||||
|
|
||||||
|
-from lxml.html.clean import clean, Cleaner
|
||||||
|
+try:
|
||||||
|
+ from lxml.html.clean import clean, Cleaner
|
||||||
|
+ html_clean_available = True
|
||||||
|
+except ImportError:
|
||||||
|
+ html_clean_available = False
|
||||||
|
|
||||||
|
feed_dirs = [
|
||||||
|
os.path.join(os.path.dirname(__file__), 'feedparser-data'),
|
||||||
|
@@ -80,6 +84,11 @@ def shortDescription(self):
|
||||||
|
|
||||||
|
def test_suite():
|
||||||
|
suite = unittest.TestSuite()
|
||||||
|
+
|
||||||
|
+ if not html_clean_available:
|
||||||
|
+ print("Skipping tests in feedparser_data - external lxml_html_clean package is not installed")
|
||||||
|
+ return suite
|
||||||
|
+
|
||||||
|
for dir in feed_dirs:
|
||||||
|
for fn in os.listdir(dir):
|
||||||
|
fn = os.path.join(dir, fn)
|
@ -0,0 +1,28 @@
|
|||||||
|
#! /bin/bash -ex
|
||||||
|
|
||||||
|
# Download a release of lxml (if missing) and remove the isoschematron module from it
|
||||||
|
|
||||||
|
version=$1
|
||||||
|
|
||||||
|
if [ -z "${version}" ]; then
|
||||||
|
echo "Usage: $0 VERSION" >& 2
|
||||||
|
echo "" >& 2
|
||||||
|
echo "example: $0 4.9.2" >& 2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
versionedname=lxml-${version}
|
||||||
|
orig_archive=${versionedname}.tar.gz
|
||||||
|
new_archive=${versionedname}-no-isoschematron-rng.tar.gz
|
||||||
|
|
||||||
|
if [ ! -e ${orig_archive} ]; then
|
||||||
|
wget -N https://files.pythonhosted.org/packages/source/l/lxml/${orig_archive}
|
||||||
|
fi
|
||||||
|
|
||||||
|
deleted_directory=lxml-${version}/src/lxml/isoschematron/resources/rng
|
||||||
|
|
||||||
|
# tar --delete does not operate on compressed archives, so do
|
||||||
|
# gz decompression explicitly
|
||||||
|
gzip --decompress ${orig_archive}
|
||||||
|
tar -v --delete -f ${orig_archive//.gz} ${deleted_directory}
|
||||||
|
gzip -cf ${orig_archive//.gz} > ${new_archive}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue