From f6d949f7d08d6cd8bb6545dc0c71743be379f7442fee904a421fac3dec3e9b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Wed, 15 Jan 2020 11:05:21 +0000 Subject: [PATCH] - Update to 0.16: - Dropped support for Python 2.6, 3.3 and 3.4 - Docutils now supports Python 2.7 and Python 3.5+ natively (without conversion by ``2to3``). - Keep `backslash escapes`__ in the document tree. Backslash characters in text are be represented by NULL characters in the ``text`` attribute of Doctree nodes and removed in the writing stage by the node's ``astext()`` method. - Remove merged patch fix_tests_38.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-docutils?expand=0&rev=61 --- docutils-0.15.2.tar.gz | 3 --- docutils-0.16.tar.gz | 3 +++ fix_tests_38.patch | 40 ---------------------------------------- python-docutils.changes | 13 +++++++++++++ python-docutils.spec | 18 +++--------------- 5 files changed, 19 insertions(+), 58 deletions(-) delete mode 100644 docutils-0.15.2.tar.gz create mode 100644 docutils-0.16.tar.gz delete mode 100644 fix_tests_38.patch diff --git a/docutils-0.15.2.tar.gz b/docutils-0.15.2.tar.gz deleted file mode 100644 index 8ac0f02..0000000 --- a/docutils-0.15.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99 -size 1797388 diff --git a/docutils-0.16.tar.gz b/docutils-0.16.tar.gz new file mode 100644 index 0000000..314ebe1 --- /dev/null +++ b/docutils-0.16.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc +size 1962041 diff --git a/fix_tests_38.patch b/fix_tests_38.patch deleted file mode 100644 index f724eec..0000000 --- a/fix_tests_38.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- a/test/test_writers/test_odt.py -+++ b/test/test_writers/test_odt.py -@@ -80,7 +80,7 @@ class DocutilsOdtTestCase(DocutilsTestSu - sys.stderr.write(s1) - return WhichElementTree - -- def process_test(self, input_filename, expected_filename, -+ def process_test(self, input_filename, expected_filename, - save_output_name=None, settings_overrides=None): - if not self.check_import(): - return -@@ -112,19 +112,22 @@ class DocutilsOdtTestCase(DocutilsTestSu - outfile.close() - content1 = self.extract_file(result, 'content.xml') - content2 = self.extract_file(expected, 'content.xml') -- msg = 'content.xml not equal: expected len: %d actual len: %d' % ( -- len(content2), len(content1), ) -- self.assertEqual(content1, content2, msg) -+ # self.assertEqual(content1, content2, msg) -+ self.assertEqual(content1, content2) - - def extract_file(self, payload, filename): -+ from xml.etree import ElementTree as etree - payloadfile = BytesIO() - payloadfile.write(payload) - payloadfile.seek(0) - zfile = zipfile.ZipFile(payloadfile, 'r') - content1 = zfile.read(filename) -- doc = minidom.parseString(content1) -- #content2 = doc.toprettyxml(indent=' ') -- content2 = doc.toxml() -+ if hasattr(etree, 'canonicalize'): -+ content2 = etree.canonicalize(content1, with_comments=True) -+ else: -+ #content2 = doc.toprettyxml(indent=' ') -+ doc = minidom.parseString(content1) -+ content2 = doc.toxml() - return content2 - - def assertEqual(self, first, second, msg=None): diff --git a/python-docutils.changes b/python-docutils.changes index 192d94b..2fc855f 100644 --- a/python-docutils.changes +++ b/python-docutils.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Jan 15 10:56:28 UTC 2020 - Tomáš Chvátal + +- Update to 0.16: + - Dropped support for Python 2.6, 3.3 and 3.4 + - Docutils now supports Python 2.7 and Python 3.5+ natively + (without conversion by ``2to3``). + - Keep `backslash escapes`__ in the document tree. Backslash characters in + text are be represented by NULL characters in the ``text`` attribute of + Doctree nodes and removed in the writing stage by the node's + ``astext()`` method. +- Remove merged patch fix_tests_38.patch + ------------------------------------------------------------------- Fri Oct 11 14:11:49 CEST 2019 - Matej Cepl diff --git a/python-docutils.spec b/python-docutils.spec index 6117844..ef45f08 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -1,7 +1,7 @@ # # spec file for package python-docutils # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,7 +26,7 @@ %endif %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-docutils%{psuffix} -Version: 0.15.2 +Version: 0.16 Release: 0 Summary: Python Documentation Utilities License: Python-2.0 AND BSD-2-Clause AND GPL-2.0-or-later AND GPL-3.0-or-later AND SUSE-Public-Domain @@ -34,9 +34,6 @@ Group: Development/Languages/Python URL: https://pypi.python.org/pypi/docutils/ Source: https://files.pythonhosted.org/packages/source/d/docutils/docutils-%{version}.tar.gz Source99: python-docutils-rpmlintrc -# PATCH-FIX-UPSTREAM fix_tests_38.patch shp#docutils#161 mcepl@suse.com -# Fixes failing tests in test_writers.test_odt.DocutilsOdtTestCase -Patch0: fix_tests_38.patch BuildRequires: %{python_module setuptools} BuildRequires: %{python_module xml} BuildRequires: fdupes @@ -66,7 +63,6 @@ easy-to-read, what-you-see-is-what-you-get plaintext markup syntax. %prep %setup -q -n docutils-%{version} -%autopatch -p1 # Remove useless ".py" ending from executables: for i in tools/rst*; do mv "$i" "${i/.py}"; done sed -i "s|'tools/\(rst.*\)\.py'|'tools/\1'|" setup.py @@ -79,14 +75,6 @@ sed -i -e "1d" "docutils/writers/xetex/__init__.py" "docutils/writers/_html_base %build %python_build -# test3 is generated from test during build -%if 0%{?have_python2} && ! 0%{?skip_python2} -mv test test%{python2_bin_suffix} -%endif -%if 0%{?have_python3} && ! 0%{?skip_python3} -mv test3 test%{python3_bin_suffix} -%endif - %install %if !%{with test} %python_install @@ -119,7 +107,7 @@ fi %check %if %{with test} -%python_exec test%{$python_bin_suffix}/alltests.py +%python_exec test/alltests.py %endif %if !%{with test}