Hi, as the previous upload triggered a new bug, I fixed it. Please find attached the new source debdiff. Best regards, Georges. -- Georges KHAZNADAR et Jocelyne FOURNIER 22 rue des mouettes, 59240 Dunkerque France. Téléphone +33 (0)3 28 29 17 70
diff -Nru python-xmlschema-1.10.0/debian/changelog python-xmlschema-1.10.0/debian/changelog
--- python-xmlschema-1.10.0/debian/changelog 2022-12-18 20:47:28.000000000 +0100
+++ python-xmlschema-1.10.0/debian/changelog 2023-04-25 17:29:03.000000000 +0200
@@ -1,3 +1,35 @@
+python-xmlschema (1.10.0-6) unstable; urgency=medium
+
+ * disabled some tests, rather than executing them conditionnally after
+ the success of "wget http://example.com". Closes: #1034751
+
+ -- Georges Khaznadar <georgesk@debian.org> Tue, 25 Apr 2023 17:29:03 +0200
+
+python-xmlschema (1.10.0-5) unstable; urgency=medium
+
+ * created a target "override_dh_auto_clean" in d/rules to copy the
+ file mypy.ini to the build directory of pybuild, so tests based
+ on mypy get a chance of success.
+ * patched the file tests/test_package.py in order to enforce
+ encoding="utf-8" for calls of fileinput.input, which may be
+ necessary with git-build-package in a chroot.
+ * patched xmlschema/testing/_builders.py and tests/test_xpath.py
+ to check whether there is Internet access prior to check structures
+ requiring to retreive schemas from http://example.com; added a
+ build-dependency on wget.
+ * those three changes should be sufficient, so it Closes: #1027439
+
+ -- Georges Khaznadar <georgesk@debian.org> Sat, 22 Apr 2023 16:24:29 +0200
+
+python-xmlschema (1.10.0-4) unstable; urgency=medium
+
+ * created the debian patch d/Fix-tests.patch, which modifies two tests:
+ xmlschema/testing/_builders.py with a true fix, and
+ tests/test_typing.py which is just disabled (not a true fix).
+ Closes: #1027439
+
+ -- Georges Khaznadar <georgesk@debian.org> Sat, 22 Apr 2023 10:58:29 +0200
+
python-xmlschema (1.10.0-3) unstable; urgency=medium
* Fix patch description
diff -Nru python-xmlschema-1.10.0/debian/control python-xmlschema-1.10.0/debian/control
--- python-xmlschema-1.10.0/debian/control 2022-12-18 20:47:28.000000000 +0100
+++ python-xmlschema-1.10.0/debian/control 2023-04-22 17:24:07.000000000 +0200
@@ -13,6 +13,7 @@
python3-setuptools,
python3-sphinx <!nodoc>,
python3-sphinx-rtd-theme <!nodoc>,
+ wget,
Rules-Requires-Root: no
Standards-Version: 4.6.2
Homepage: https://github.com/sissaschool/xmlschema
diff -Nru python-xmlschema-1.10.0/debian/patches/Fix-encoding.patch python-xmlschema-1.10.0/debian/patches/Fix-encoding.patch
--- python-xmlschema-1.10.0/debian/patches/Fix-encoding.patch 1970-01-01 01:00:00.000000000 +0100
+++ python-xmlschema-1.10.0/debian/patches/Fix-encoding.patch 2023-04-25 17:29:03.000000000 +0200
@@ -0,0 +1,40 @@
+enforced encoding="utf-8" for calls of fileinput.input, since it
+may be necessary during the package build in some environments
+Index: python-xmlschema/tests/test_package.py
+===================================================================
+--- python-xmlschema.orig/tests/test_package.py
++++ python-xmlschema/tests/test_package.py
+@@ -42,7 +42,7 @@ class TestPackaging(unittest.TestCase):
+ file_excluded = []
+ files = glob.glob(os.path.join(self.source_dir, '*.py')) + \
+ glob.glob(os.path.join(self.source_dir, 'validators/*.py'))
+- for line in fileinput.input(files):
++ for line in fileinput.input(files, encoding="utf-8"):
+ if fileinput.isfirstline():
+ filename = fileinput.filename()
+ file_excluded = exclude.get(os.path.basename(filename), [])
+@@ -66,7 +66,7 @@ class TestPackaging(unittest.TestCase):
+ os.path.join(self.package_dir, 'doc/conf.py'),
+ ])
+ version = filename = None
+- for line in fileinput.input(files):
++ for line in fileinput.input(files, encoding="utf-8"):
+ if fileinput.isfirstline():
+ filename = fileinput.filename()
+ lineno = fileinput.filelineno()
+@@ -84,13 +84,13 @@ class TestPackaging(unittest.TestCase):
+ def test_elementpath_requirement(self):
+ package_dir = pathlib.Path(__file__).parent.parent
+ ep_requirement = None
+- for line in fileinput.input(str(package_dir.joinpath('requirements-dev.txt'))):
++ for line in fileinput.input(str(package_dir.joinpath('requirements-dev.txt')), encoding="utf-8"):
+ if 'elementpath' in line:
+ ep_requirement = line.strip()
+
+ self.assertIsNotNone(ep_requirement, msg="Missing elementpath in requirements-dev.txt")
+
+- for line in fileinput.input(str(package_dir.joinpath('setup.py'))):
++ for line in fileinput.input(str(package_dir.joinpath('setup.py')), encoding="utf-8"):
+ if 'elementpath' in line:
+ self.assertIn(ep_requirement, line, msg="Unmatched requirement in setup.py")
+
diff -Nru python-xmlschema-1.10.0/debian/patches/Fix-new-elementpath-context-iter.patch python-xmlschema-1.10.0/debian/patches/Fix-new-elementpath-context-iter.patch
--- python-xmlschema-1.10.0/debian/patches/Fix-new-elementpath-context-iter.patch 1970-01-01 01:00:00.000000000 +0100
+++ python-xmlschema-1.10.0/debian/patches/Fix-new-elementpath-context-iter.patch 2023-04-25 17:29:03.000000000 +0200
@@ -0,0 +1,16 @@
+XMLSchemaContext instances have no iter() method,
+but their property .root does.
+
+Index: python-xmlschema/xmlschema/testing/_builders.py
+===================================================================
+--- python-xmlschema.orig/xmlschema/testing/_builders.py
++++ python-xmlschema/xmlschema/testing/_builders.py
+@@ -126,7 +126,7 @@ def make_schema_test_class(test_file, te
+ if not inspect and not self.errors:
+ context = XMLSchemaContext(schema)
+ elements = [x for x in schema.iter()] # Contains schema elements only
+- xpath_context_elements = [x for x in context.iter() if isinstance(x, XsdValidator)]
++ xpath_context_elements = [x for x in context.root.iter() if isinstance(x, XsdValidator)]
+ descendants = [x for x in context.iter_descendants('descendant-or-self')]
+ self.assertTrue(x in descendants for x in xpath_context_elements)
+ for e in elements:
diff -Nru python-xmlschema-1.10.0/debian/patches/series python-xmlschema-1.10.0/debian/patches/series
--- python-xmlschema-1.10.0/debian/patches/series 2022-12-18 20:47:28.000000000 +0100
+++ python-xmlschema-1.10.0/debian/patches/series 2023-04-25 17:29:03.000000000 +0200
@@ -1 +1,3 @@
Skip-failing-packaging-test.patch
+Fix-new-elementpath-context-iter.patch
+Fix-encoding.patch
diff -Nru python-xmlschema-1.10.0/debian/patches/Skip-failing-packaging-test.patch python-xmlschema-1.10.0/debian/patches/Skip-failing-packaging-test.patch
--- python-xmlschema-1.10.0/debian/patches/Skip-failing-packaging-test.patch 2022-12-18 20:47:28.000000000 +0100
+++ python-xmlschema-1.10.0/debian/patches/Skip-failing-packaging-test.patch 2023-04-25 17:29:03.000000000 +0200
@@ -9,15 +9,46 @@
tests/test_package.py | 1 +
1 file changed, 1 insertion(+)
-diff --git a/tests/test_package.py b/tests/test_package.py
-index 5d2cc23..7107d57 100644
---- a/tests/test_package.py
-+++ b/tests/test_package.py
-@@ -81,6 +81,7 @@ class TestPackaging(unittest.TestCase):
- message % (lineno, filename, match.group(1).strip('\'\"'), version)
- )
+Index: python-xmlschema/xmlschema/testing/_builders.py
+===================================================================
+--- python-xmlschema.orig/xmlschema/testing/_builders.py
++++ python-xmlschema/xmlschema/testing/_builders.py
+@@ -17,6 +17,7 @@ import logging
+ import importlib
+ import tempfile
+ import warnings
++import unittest
-+ @unittest.skip("Not needed for Debian")
- def test_elementpath_requirement(self):
- package_dir = pathlib.Path(__file__).parent.parent
- ep_requirement = None
+ try:
+ import lxml.etree as lxml_etree
+@@ -197,6 +198,8 @@ def make_schema_test_class(test_file, te
+ lxml_schema_time, xmlschema_time, xsd_file, self.__class__.__name__
+ ))
+
++ @unittest.skip(
++ "Requires network access, not granted during the Debian build")
+ def test_xsd_file(self):
+ if inspect:
+ SchemaObserver.clear()
+@@ -609,6 +612,8 @@ def make_validation_test_class(test_file
+ finally:
+ os.chdir(cwd)
+
++ @unittest.skip(
++ "Requires network access, not granted during the Debian build")
+ def test_xml_document_validation(self):
+ if not validation_only:
+ self.check_decoding_with_element_tree()
+Index: python-xmlschema/tests/test_xpath.py
+===================================================================
+--- python-xmlschema.orig/tests/test_xpath.py
++++ python-xmlschema/tests/test_xpath.py
+@@ -58,6 +58,8 @@ class XMLSchemaProxyTest(unittest.TestCa
+ schema_proxy2.bind_parser(parser)
+ self.assertIs(parser.schema, schema_proxy2)
+
++ @unittest.skip(
++ "Requires network access, not granted during the Debian build")
+ def test_get_context_method(self):
+ schema_proxy = XMLSchemaProxy(self.xs1)
+ context = schema_proxy.get_context()
diff -Nru python-xmlschema-1.10.0/debian/rules python-xmlschema-1.10.0/debian/rules
--- python-xmlschema-1.10.0/debian/rules 2022-12-18 20:47:28.000000000 +0100
+++ python-xmlschema-1.10.0/debian/rules 2023-04-25 17:29:03.000000000 +0200
@@ -51,3 +51,9 @@
rm -rf doc/_build
rm -f unicode_categories.json xmlschema/unicode_categories.json
rm -f *.1
+
+BUILDDIR = $(shell find . -name 'build')
+override_dh_auto_test:
+ cp mypy.ini requirements-dev.txt $(BUILDDIR)
+ dh_auto_test
+ rm -f $(BUILDDIR)/mypy.ini $(BUILDDIR)/requirements-dev.txt
Attachment:
signature.asc
Description: PGP signature