From ae521c805bc8bb1bdc61002ae784526f221e9d1c Mon Sep 17 00:00:00 2001 From: Matej Stuchlik Date: Thu, 11 Jul 2013 08:54:59 +0200 Subject: [PATCH] Rebase to revision 7687 --- disable-failing-tests.patch | 13 -- docutils-__import__-fixes2.patch | 66 ------- docutils-__import__-tests.patch | 300 ------------------------------- python-docutils.spec | 22 +-- 4 files changed, 8 insertions(+), 393 deletions(-) delete mode 100644 docutils-__import__-fixes2.patch delete mode 100644 docutils-__import__-tests.patch diff --git a/disable-failing-tests.patch b/disable-failing-tests.patch index 390ae92..c8a6304 100644 --- a/disable-failing-tests.patch +++ b/disable-failing-tests.patch @@ -1,16 +1,3 @@ -diff -up docutils-0.10/test/test_error_reporting.py.disable-failing-tests docutils-0.10/test/test_error_reporting.py ---- docutils-0.10/test/test_error_reporting.py.disable-failing-tests 2012-07-30 23:57:17.000000000 -0400 -+++ docutils-0.10/test/test_error_reporting.py 2012-08-23 20:54:50.761166815 -0400 -@@ -145,6 +145,8 @@ class ErrorStringTests(unittest.TestCase - self.assertEqual('ImportError: %s' % SafeString(self.us), - str(ErrorString(ImportError(self.us)))) - -+ @unittest.skipIf(sys.version_info[:2] == (3, 3), -+ "known failure with Python 3.3; http://sourceforge.net/tracker/?func=detail&aid=3561133&group_id=38414&atid=422030") - def test_unicode(self): - self.assertEqual(u'Exception: spam', - unicode(ErrorString(Exception(u'spam')))) - diff -up docutils-0.10/test/test_writers/test_odt.py.disable-failing-tests docutils-0.10/test/test_writers/test_odt.py --- docutils-0.10/test/test_writers/test_odt.py.disable-failing-tests 2012-07-30 23:57:13.000000000 -0400 +++ docutils-0.10/test/test_writers/test_odt.py 2012-08-23 20:54:50.763166817 -0400 diff --git a/docutils-__import__-fixes2.patch b/docutils-__import__-fixes2.patch deleted file mode 100644 index 91505ea..0000000 --- a/docutils-__import__-fixes2.patch +++ /dev/null @@ -1,66 +0,0 @@ -Index: docutils/readers/__init__.py -=================================================================== ---- docutils/readers/__init__.py.orig -+++ docutils/readers/__init__.py -@@ -106,5 +106,8 @@ def get_reader_class(reader_name): - reader_name = reader_name.lower() - if reader_name in _reader_aliases: - reader_name = _reader_aliases[reader_name] -- module = __import__(reader_name, globals(), locals(), level=1) -+ try: -+ module = __import__(reader_name, globals(), locals(), level=0) -+ except ImportError: -+ module = __import__(reader_name, globals(), locals(), level=1) - return module.Reader -Index: docutils/parsers/__init__.py -=================================================================== ---- docutils/parsers/__init__.py.orig -+++ docutils/parsers/__init__.py -@@ -46,5 +46,8 @@ def get_parser_class(parser_name): - parser_name = parser_name.lower() - if parser_name in _parser_aliases: - parser_name = _parser_aliases[parser_name] -- module = __import__(parser_name, globals(), locals(), level=1) -+ try: -+ module = __import__(parser_name, globals(), locals(), level=0) -+ except ImportError: -+ module = __import__(parser_name, globals(), locals(), level=1) - return module.Parser -Index: docutils/languages/__init__.py -=================================================================== ---- docutils/languages/__init__.py.orig -+++ docutils/languages/__init__.py -@@ -30,9 +30,12 @@ def get_language(language_code, reporter - if tag in _languages: - return _languages[tag] - try: -- module = __import__(tag, globals(), locals(), level=1) -+ module = __import__(tag, globals(), locals(), level=0) - except ImportError: -- continue -+ try: -+ module = __import__(tag, globals(), locals(), level=1) -+ except ImportError: -+ continue - _languages[tag] = module - return module - if reporter is not None: -Index: docutils/parsers/rst/languages/__init__.py -=================================================================== ---- docutils/parsers/rst/languages/__init__.py.orig -+++ docutils/parsers/rst/languages/__init__.py -@@ -25,9 +25,12 @@ def get_language(language_code): - if tag in _languages: - return _languages[tag] - try: -- module = __import__(tag, globals(), locals(), level=1) -+ module = __import__(tag, globals(), locals(), level=0) - except ImportError: -- continue -+ try: -+ module = __import__(tag, globals(), locals(), level=1) -+ except ImportError: -+ continue - _languages[tag] = module - return module - return None diff --git a/docutils-__import__-tests.patch b/docutils-__import__-tests.patch deleted file mode 100644 index 8262be6..0000000 --- a/docutils-__import__-tests.patch +++ /dev/null @@ -1,300 +0,0 @@ -Index: test/local-reader.py -=================================================================== ---- /dev/null -+++ test/local-reader.py -@@ -0,0 +1,20 @@ -+# -*- coding: utf-8 -*- -+# $Id: local-writer.py 7500 2012-08-22 19:38:14Z grubert $ -+# Authors: Engelbert Gruber -+# Toshio Kuratomi -+# Copyright: This module is put into the public domain. -+ -+""" -+mini-reader to test get_reader_class with local reader -+""" -+ -+import docutils -+from docutils import readers -+ -+class Reader(readers.Reader): -+ -+ supported = ('dummy',) -+ """Formats this reader supports.""" -+ -+ document = None -+ """A document tree.""" -Index: test/test_readers/test_get_reader_class.py -=================================================================== ---- /dev/null -+++ test/test_readers/test_get_reader_class.py -@@ -0,0 +1,32 @@ -+#! /usr/bin/env python -+ -+# $Id: test_get_writer_class.py 7500 2012-08-22 19:38:14Z grubert $ -+# Author: grubert abadger1999 -+# Maintainer: docutils-develop@lists.sourceforge.net -+# Copyright: This module has been placed in the public domain. -+ -+""" -+test get_reader_class -+""" -+ -+from __init__ import DocutilsTestSupport -+from docutils.readers import get_reader_class -+ -+class GetReaderClassTestCase(DocutilsTestSupport.StandardTestCase): -+ -+ def test_registered_reader(self): -+ rdr = get_reader_class('pep') -+ # raises ImportError on failure -+ -+ def test_bogus_reader(self): -+ self.assertRaises(ImportError, -+ get_reader_class, 'nope') -+ -+ def test_local_reader(self): -+ # requires local-reader.py in test directory (testroot) -+ wr = get_reader_class('local-reader') -+ -+if __name__ == '__main__': -+ import unittest -+ unittest.main() -+ -Index: test/local-parser.py -=================================================================== ---- /dev/null -+++ test/local-parser.py -@@ -0,0 +1,21 @@ -+# -*- coding: utf-8 -*- -+# $Id: local-writer.py 7500 2012-08-22 19:38:14Z grubert $ -+# Authors: Engelbert Gruber -+# Toshio Kuratomi -+# Copyright: This module is put into the public domain. -+ -+""" -+mini-reader to test get_reader_class with local reader -+""" -+ -+from docutils import parsers -+ -+class Parser(parsers.Parser): -+ -+ supported = ('dummy',) -+ """Formats this reader supports.""" -+ -+ def parser(self, inputstring, document): -+ self.setup_parse(inputstring, document) -+ document = dict() -+ self.finish_parse() -Index: test/test_parsers/test_get_parser_class.py -=================================================================== ---- /dev/null -+++ test/test_parsers/test_get_parser_class.py -@@ -0,0 +1,32 @@ -+#! /usr/bin/env python -+ -+# $Id: test_get_writer_class.py 7500 2012-08-22 19:38:14Z grubert $ -+# Author: grubert abadger1999 -+# Maintainer: docutils-develop@lists.sourceforge.net -+# Copyright: This module has been placed in the public domain. -+ -+""" -+test get_parser_class -+""" -+ -+from __init__ import DocutilsTestSupport -+from docutils.parsers import get_parser_class -+ -+class GetParserClassTestCase(DocutilsTestSupport.StandardTestCase): -+ -+ def test_registered_parser(self): -+ rdr = get_parser_class('rst') -+ # raises ImportError on failure -+ -+ def test_bogus_parser(self): -+ self.assertRaises(ImportError, -+ get_parser_class, 'nope') -+ -+ def test_local_parser(self): -+ # requires local-parser.py in test directory (testroot) -+ wr = get_parser_class('local-parser') -+ -+if __name__ == '__main__': -+ import unittest -+ unittest.main() -+ -Index: test/test_language.py -=================================================================== ---- test/test_language.py.orig -+++ test/test_language.py -@@ -53,6 +53,11 @@ class LanguageTestSuite(DocutilsTestSupp - # test language tag normalization: - self.languages += ['en_gb', 'en_US', 'en-CA', 'de-DE', 'de-AT-1901', - 'pt-BR', 'pt-foo-BR'] -+ # test that locally created language files are also loaded. -+ # requires local_dummy_lang.py in test directory (testroot) -+ # The local_dummy_lang.py contains all the fields from both -+ # the docutils language tags and the parser.rst language tags -+ self.languages += ['local_dummy_lang'] - - def generateTests(self): - for language in self.languages: -Index: test/local_dummy_lang.py -=================================================================== ---- /dev/null -+++ test/local_dummy_lang.py -@@ -0,0 +1,154 @@ -+# $Id: en.py 4564 2006-05-21 20:44:42Z wiemann $ -+# Author: David Goodger -+# Copyright: This module has been placed in the public domain. -+ -+# New language mappings are welcome. Before doing a new translation, please -+# read . Two files must be -+# translated for each language: one in docutils/languages, the other in -+# docutils/parsers/rst/languages. -+ -+""" -+English-language mappings for language-dependent features of Docutils. -+""" -+ -+__docformat__ = 'reStructuredText' -+ -+labels = { -+ # fixed: language-dependent -+ 'author': 'dummy Author', -+ 'authors': 'dummy Authors', -+ 'organization': 'dummy Organization', -+ 'address': 'dummy Address', -+ 'contact': 'dummy Contact', -+ 'version': 'dummy Version', -+ 'revision': 'dummy Revision', -+ 'status': 'dummy Status', -+ 'date': 'dummy Date', -+ 'copyright': 'dummy Copyright', -+ 'dedication': 'dummy Dedication', -+ 'abstract': 'dummy Abstract', -+ 'attention': 'dummy Attention!', -+ 'caution': 'dummy Caution!', -+ 'danger': 'dummy !DANGER!', -+ 'error': 'dummy Error', -+ 'hint': 'dummy Hint', -+ 'important': 'dummy Important', -+ 'note': 'dummy Note', -+ 'tip': 'dummy Tip', -+ 'warning': 'dummy Warning', -+ 'contents': 'dummy Contents'} -+"""Mapping of node class name to label text.""" -+ -+bibliographic_fields = { -+ # language-dependent: fixed -+ 'dummy author': 'author', -+ 'dummy authors': 'authors', -+ 'dummy organization': 'organization', -+ 'dummy address': 'address', -+ 'dummy contact': 'contact', -+ 'dummy version': 'version', -+ 'dummy revision': 'revision', -+ 'dummy status': 'status', -+ 'dummy date': 'date', -+ 'dummy copyright': 'copyright', -+ 'dummy dedication': 'dedication', -+ 'dummy abstract': 'abstract'} -+"""English (lowcased) to canonical name mapping for bibliographic fields.""" -+ -+author_separators = [';', ','] -+"""List of separator strings for the 'Authors' bibliographic field. Tried in -+order.""" -+ -+directives = { -+ # language-dependent: fixed -+ 'dummy attention': 'attention', -+ 'dummy caution': 'caution', -+ 'dummy code': 'code', -+ 'dummy code-block': 'code', -+ 'dummy sourcecode': 'code', -+ 'dummy danger': 'danger', -+ 'dummy error': 'error', -+ 'dummy hint': 'hint', -+ 'dummy important': 'important', -+ 'dummy note': 'note', -+ 'dummy tip': 'tip', -+ 'dummy warning': 'warning', -+ 'dummy admonition': 'admonition', -+ 'dummy sidebar': 'sidebar', -+ 'dummy topic': 'topic', -+ 'dummy line-block': 'line-block', -+ 'dummy parsed-literal': 'parsed-literal', -+ 'dummy rubric': 'rubric', -+ 'dummy epigraph': 'epigraph', -+ 'dummy highlights': 'highlights', -+ 'dummy pull-quote': 'pull-quote', -+ 'dummy compound': 'compound', -+ 'dummy container': 'container', -+ #'dummy questions': 'questions', -+ 'dummy table': 'table', -+ 'dummy csv-table': 'csv-table', -+ 'dummy list-table': 'list-table', -+ #'dummy qa': 'questions', -+ #'dummy faq': 'questions', -+ 'dummy meta': 'meta', -+ 'dummy math': 'math', -+ #'dummy imagemap': 'imagemap', -+ 'dummy image': 'image', -+ 'dummy figure': 'figure', -+ 'dummy include': 'include', -+ 'dummy raw': 'raw', -+ 'dummy replace': 'replace', -+ 'dummy unicode': 'unicode', -+ 'dummy date': 'date', -+ 'dummy class': 'class', -+ 'dummy role': 'role', -+ 'dummy default-role': 'default-role', -+ 'dummy title': 'title', -+ 'dummy contents': 'contents', -+ 'dummy sectnum': 'sectnum', -+ 'dummy section-numbering': 'sectnum', -+ 'dummy header': 'header', -+ 'dummy footer': 'footer', -+ #'dummy footnotes': 'footnotes', -+ #'dummy citations': 'citations', -+ 'dummy target-notes': 'target-notes', -+ 'dummy restructuredtext-test-directive': 'restructuredtext-test-directive'} -+"""English name to registered (in directives/__init__.py) directive name -+mapping.""" -+ -+roles = { -+ # language-dependent: fixed -+ 'dummy abbreviation': 'abbreviation', -+ 'dummy ab': 'abbreviation', -+ 'dummy acronym': 'acronym', -+ 'dummy ac': 'acronym', -+ 'dummy code': 'code', -+ 'dummy index': 'index', -+ 'dummy i': 'index', -+ 'dummy subscript': 'subscript', -+ 'dummy sub': 'subscript', -+ 'dummy superscript': 'superscript', -+ 'dummy sup': 'superscript', -+ 'dummy title-reference': 'title-reference', -+ 'dummy title': 'title-reference', -+ 'dummy t': 'title-reference', -+ 'dummy pep-reference': 'pep-reference', -+ 'dummy pep': 'pep-reference', -+ 'dummy rfc-reference': 'rfc-reference', -+ 'dummy rfc': 'rfc-reference', -+ 'dummy emphasis': 'emphasis', -+ 'dummy strong': 'strong', -+ 'dummy literal': 'literal', -+ 'dummy math': 'math', -+ 'dummy named-reference': 'named-reference', -+ 'dummy anonymous-reference': 'anonymous-reference', -+ 'dummy footnote-reference': 'footnote-reference', -+ 'dummy citation-reference': 'citation-reference', -+ 'dummy substitution-reference': 'substitution-reference', -+ 'dummy target': 'target', -+ 'dummy uri-reference': 'uri-reference', -+ 'dummy uri': 'uri-reference', -+ 'dummy url': 'uri-reference', -+ 'dummy raw': 'raw',} -+"""Mapping of English role names to canonical role names for interpreted text. -+""" diff --git a/python-docutils.spec b/python-docutils.spec index f718357..0a29538 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -10,8 +10,8 @@ %global srcname docutils Name: python-%{srcname} -Version: 0.10 -Release: 0.8.20120824svn7502%{?dist} +Version: 0.11 +Release: 0.1.20130715svn7687%{?dist} Summary: System for processing plaintext documentation Group: Development/Languages @@ -20,23 +20,15 @@ License: Public Domain and BSD and Python and GPLv3+ URL: http://docutils.sourceforge.net #Source0: http://downloads.sourceforge.net/docutils/%{srcname}-%{version}.tar.gz # Sometimes we need snapshots. Instructions below: -# svn co -r 7502 https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils +# svn co -r 7687 svn://svn.code.sf.net/p/docutils/code/trunk/docutils # cd docutils # python setup.py sdist # The tarball is in dist/docutils-VERSION.tar.gz Source0: %{srcname}-%{version}.tar.gz -# Submitted upstream: https://sourceforge.net/tracker/index.php?func=detail&aid=3560841&group_id=38414&atid=422030 -Patch0: docutils-__import__-tests.patch -Patch1: docutils-__import__-fixes2.patch # Disable some tests known to fail with Python 3.3 # Bug reports filed upstream as: # https://sourceforge.net/tracker/?func=detail&aid=3555164&group_id=38414&atid=422030 -# and: -# http://sourceforge.net/tracker/?func=detail&aid=3561133&group_id=38414&atid=422030 -# Unicode test is failing because of a python3.3b2 bug: -# ImportError(b'str').__str__() returns bytes rather than str -# http://bugs.python.org/issue15778 Patch100: disable-failing-tests.patch @@ -88,12 +80,10 @@ This package contains the module, ported to run under python3. %prep %setup -q -n %{srcname}-%{version} -%patch0 -p0 -%patch1 -p0 %patch100 -p1 -b .disable-failing-tests # Remove shebang from library files -for file in docutils/utils/{code_analyzer.py,punctuation_chars.py,error_reporting.py} docutils/utils/math/{latex2mathml.py,math2html.py} docutils/writers/xetex/__init__.py; do +for file in docutils/utils/{code_analyzer.py,punctuation_chars.py,error_reporting.py,smartquotes.py} docutils/utils/math/{latex2mathml.py,math2html.py} docutils/writers/xetex/__init__.py; do sed -i -e '/#! *\/usr\/bin\/.*/{1D}' $file done @@ -171,6 +161,10 @@ rm -rf %{buildroot} %endif %changelog +* Mon Jul 15 2013 Matej Stuchlik - 0.11-0.1.20130715svn7687 +- Rebased to new snapshot +- Removed unnecessary patches + * Thu Mar 21 2013 Toshio Kuratomi - 0.10-0.8.20120824svn7502 - Add python3-imaging support :-)