dev-python/docutils: major improvements.
authorMathy Vanvoorden <mathy@vanvoorden.be>
Wed, 19 Oct 2016 10:09:44 +0000 (12:09 +0200)
committerPatrice Clement <monsieurp@gentoo.org>
Wed, 19 Oct 2016 16:30:06 +0000 (18:30 +0200)
This commit:
* bumps EAPI.
* fixes EPYTHON.
* removes python3.3.
* removes version 0.10 and version 0.9.1-r1.
* revision-bumps to version 0.12-r1.
* fixes testing: testing was broken both for CPython and PyPy, it was solved
by two patches. One is from upstream, the other has been submitted to upstream.

Upstream submission: https://sourceforge.net/p/docutils/patches/136/

Gentoo-Bug: https://bugs.gentoo.org/452792
Gentoo-Bug: https://bugs.gentoo.org/451830
Gentoo-Bug: https://bugs.gentoo.org/529930
Gentoo-Bug: https://bugs.gentoo.org/593754

Courtesy of Mathy Vanvoorden <mathy@vanvoorden.be>.

Package-Manager: portage-2.3.0
Closes: https://github.com/gentoo/gentoo/pull/2600
Signed-off-by: Patrice Clement <monsieurp@gentoo.org>
dev-python/docutils/Manifest
dev-python/docutils/docutils-0.12-r1.ebuild [moved from dev-python/docutils/docutils-0.10.ebuild with 59% similarity]
dev-python/docutils/docutils-0.9.1-r1.ebuild [deleted file]
dev-python/docutils/files/docutils-0.10-optparser.patch [deleted file]
dev-python/docutils/files/docutils-0.12-fix-tests-pygments.patch [new file with mode: 0644]
dev-python/docutils/files/docutils-0.12-fix-tests-pypy.patch [new file with mode: 0644]
dev-python/docutils/metadata.xml

index 915b23bb9ee8cb85f37b1f66c52a17944e785cf0..5bf78cae7e9f8af1a85b08fc9c5d162001a64a67 100644 (file)
@@ -1,5 +1,2 @@
-DIST docutils-0.10.tar.gz 1602552 SHA256 370624e61b6773da2f2fb17cc2a4eaea4bb596c3585d13f75ff193c1c738603e SHA512 255474d4d9efc427ecb2123939af64475335c1f2af2f1b398a0c540693629f6ce6b105fb45f6ef962800948e2844b5140ecc6b81218e3c8619d14c9c7f2705c4 WHIRLPOOL 7e25c5b9206f019acc9131a0b5baf05fd21d042d121e2c472a8d908cc668346e26572d6db6546200dc9b85fb9b8a462e3ada59eb9c760f9915efaa510ffe74fa
 DIST docutils-0.11.tar.gz 1611755 SHA256 9af4166adf364447289c5c697bb83c52f1d6f57e77849abcccd6a4a18a5e7ec9 SHA512 8e87581b27ce4fb5e97dcef56047f4bf3a076b98e9e42f5dc66f4c370e5893d1571e46f00fee6f1c8b9f8c8a79e128e4599b9ee213ad1dee2bf16a0246e187df WHIRLPOOL 0231e34e8c84a29f52f244dfe8d3fdbb8f2db9f6e5f26d0a5953c109a2620b15f86874e3b7604aeccf805f789abef7e7af5cc076dde25f2e2947bad11d2ae58c
 DIST docutils-0.12.tar.gz 1618353 SHA256 c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa SHA512 0087433f8b76e1d0302d2fab77fdbda941132d16ac1fcecb26ca66119687eefd9e2f6901e05d705f857fa31e2526136c9827dfd57c44cd295bd10dcce3faebf9 WHIRLPOOL 9b9d9d7315351e4b803195a157836df13a10fc706c0aea2c6ac7c6d01bd034870106d0ceedfbd7e9fae17420f3d116df30cc222ad5b3c7205d5eca767d550564
-DIST docutils-0.9.1.tar.gz 1541437 SHA256 e89f187dbbc6674f839239c89fec44af9f18809b66a8a55a41b57b9ee2356994 SHA512 ac1158c562533796f26d4bc451cc9cd371f7fad60d190aa43c763d53a15c2b7656962e7ef72248439896a5fd759c53f6aee14b08bca2292542e944fa9bb044e9 WHIRLPOOL 6b197c1e96a218d9a3a2116ea6e68cae22130c77025fe6e6942f698a918b96579a9216daf23e01cb1c54c7d52ddcc4a3e8ec1b8279ae7be7e3044e044e14c039
-DIST glep-0.4-r1.tbz2 4667 SHA256 d0b421869fb3437e96484687fd57f34d4f5cdd5a1fbdb2314f1474b1f9afa058 SHA512 098d9f5043a60af9dfac63f6472b576e66ffeda924902ca825ed63f573aeb8bad7c9f9a6853fd99e648683488ee6db2ee55c139df3dde06983b72cfb5dd8cdd3 WHIRLPOOL 277cdf4a7fe70990864a4f0fd592561bcf5edc1de8d4830da96c75093d47d8d64214b95ac5ae7960670a8520650a5e23355df248f61bddcd9cd5dc23cab0fe19
similarity index 59%
rename from dev-python/docutils/docutils-0.10.ebuild
rename to dev-python/docutils/docutils-0.12-r1.ebuild
index 15242cc91e1e07eb3fba81c9a4c5e647bb0b31bf..ff9e7696d4286af381da2a5df062695f182efef9 100644 (file)
@@ -1,9 +1,10 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI="5"
-PYTHON_COMPAT=( python{2_7,3_3} pypy )
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{4,5} pypy pypy3 )
 
 inherit distutils-r1
 
@@ -13,16 +14,18 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
 
 LICENSE="BSD-2 GPL-3 public-domain"
 SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="glep"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
 
 DEPEND="dev-python/pygments[${PYTHON_USEDEP}]"
-RDEPEND="${DEPEND}
-       glep? ( dev-python/docutils-glep[${PYTHON_USEDEP}] )"
+RDEPEND="${DEPEND}"
 
 PATCHES=(
-       # fix buildhtml.py option parsing
-       "${FILESDIR}"/${P}-optparser.patch
+       # Upstream patch to fix tests
+       "${FILESDIR}/${P}-fix-tests-pygments.patch"
+
+       # Patch to fix pypyp tests
+       "${FILESDIR}/${P}-fix-tests-pypy.patch"
 )
 
 python_compile_all() {
@@ -32,17 +35,18 @@ python_compile_all() {
        cp docutils/writers/html4css1/html4css1.css . || die
 
        cd tools || die
-       "${PYTHON}" buildhtml.py --input-encoding=utf-8 \
+       "${EPYTHON}" buildhtml.py --input-encoding=utf-8 \
                --stylesheet-path=../html4css1.css, --traceback ../docs || die
 }
 
 python_test() {
-       local tests=test
-       [[ ${EPYTHON} == python3* ]] && tests=test3
-
-       cp -r -l ${tests} "${BUILD_DIR}"/test || die
-       ln -s "${S}"/docs "${BUILD_DIR}"/ || die
-       "${PYTHON}" "${BUILD_DIR}"/test/alltests.py || die "Tests fail with ${EPYTHON}"
+       if python_is_python3; then
+               pushd test3 > /dev/null || die
+       else
+               pushd test > /dev/null || die
+       fi
+       "${EPYTHON}" alltests.py || die "Testing failed with ${EPYTHON}"
+       popd > /dev/null || die
 }
 
 python_install() {
diff --git a/dev-python/docutils/docutils-0.9.1-r1.ebuild b/dev-python/docutils/docutils-0.9.1-r1.ebuild
deleted file mode 100644 (file)
index 5d8aaa8..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="5"
-PYTHON_COMPAT=( python2_7 )
-
-inherit distutils-r1
-
-DESCRIPTION="Python Documentation Utilities"
-HOMEPAGE="http://docutils.sourceforge.net/ https://pypi.python.org/pypi/docutils"
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
-SRC_URI+=" glep? ( mirror://gentoo/glep-0.4-r1.tbz2 )"
-
-LICENSE="BSD-2 GPL-3 public-domain"
-SLOT="0"
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="glep"
-
-RDEPEND="dev-python/pygments[${PYTHON_USEDEP}]"
-DEPEND="${RDEPEND}"
-
-GLEP_SRC="${WORKDIR}/glep-0.4-r1"
-
-python_prepare_all() {
-       # It's easier to move them around now.
-       # TODO: add python_newmodule?
-       if use glep; then
-               mkdir "${GLEP_SRC}"/{read,trans} || die
-               mv "${GLEP_SRC}"/{glepread,read/glep}.py || die
-               mv "${GLEP_SRC}"/{glepstrans,trans/gleps}.py || die
-       fi
-
-       distutils-r1_python_prepare_all
-}
-
-python_compile_all() {
-       # Generate html docs from reStructured text sources.
-
-       # Place html4css1.css in base directory to ensure that the generated reference to it is correct.
-       cp docutils/writers/html4css1/html4css1.css . || die
-
-       cd tools || die
-       "${PYTHON}" buildhtml.py --input-encoding=utf-8 \
-               --stylesheet-path=../html4css1.css --traceback ../docs || die
-}
-
-python_test() {
-       local tests=test
-       [[ ${EPYTHON} == python3* ]] && tests=test3
-
-       cp -r -l ${tests} "${BUILD_DIR}"/test || die
-       ln -s "${S}"/docs "${BUILD_DIR}"/ || die
-       "${PYTHON}" "${BUILD_DIR}"/test/alltests.py || die "Tests fail with ${EPYTHON}"
-}
-
-python_install() {
-       distutils-r1_python_install
-
-       # Install tools.
-       python_doscript tools/{buildhtml,quicktest}.py
-
-       # Install Gentoo GLEP tools.
-       if use glep; then
-               python_doscript "${GLEP_SRC}"/glep.py
-
-               python_moduleinto docutils/readers
-               python_domodule "${GLEP_SRC}"/read/glep.py
-               python_moduleinto docutils/transforms
-               python_domodule "${GLEP_SRC}"/trans/gleps.py
-               python_moduleinto docutils/writers
-               python_domodule "${GLEP_SRC}"/glep_html
-       fi
-}
-
-install_txt_doc() {
-       local doc="${1}"
-       local dir="txt/$(dirname ${doc})"
-       docinto "${dir}"
-       dodoc "${doc}"
-}
-
-python_install_all() {
-       local DOCS=( *.txt )
-       local HTML_DOCS=( docs tools docutils/writers/html4css1/html4css1.css )
-
-       distutils-r1_python_install_all
-
-       local doc
-       while IFS= read -r -d '' doc; do
-               install_txt_doc "${doc}"
-       done < <(find docs tools -name '*.txt' -print0)
-}
diff --git a/dev-python/docutils/files/docutils-0.10-optparser.patch b/dev-python/docutils/files/docutils-0.10-optparser.patch
deleted file mode 100644 (file)
index 0e9f7ed..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-Patch by Arfrever
-https://sourceforge.net/tracker/?func=detail&aid=3598893&group_id=38414&atid=422030
-
-Index: docutils/frontend.py
-===================================================================
---- docutils/frontend.py       (revision 7578)
-+++ docutils/frontend.py       (working copy)
-@@ -158,7 +158,7 @@
- def validate_colon_separated_string_list(
-     setting, value, option_parser, config_parser=None, config_section=None):
--    if isinstance(value, unicode):
-+    if isinstance(value, basestring):
-         value = value.split(':')
-     else:
-         last = value.pop()
-@@ -171,7 +171,7 @@
-     """
-     # `value` is already a list when  given as command line option
-     # and "action" is "append"
--    if isinstance(value, unicode):
-+    if isinstance(value, basestring):
-         value = [value]
-     # this function is called for every option added to `value`
-     # -> split the last item and apped the result:
-@@ -731,7 +731,7 @@
-         """Wrapper around sys.stderr catching en-/decoding errors"""
-     def read(self, filenames, option_parser):
--        if type(filenames) in (str, unicode):
-+        if isinstance(filenames, basestring):
-             filenames = [filenames]
-         for filename in filenames:
-             try:
diff --git a/dev-python/docutils/files/docutils-0.12-fix-tests-pygments.patch b/dev-python/docutils/files/docutils-0.12-fix-tests-pygments.patch
new file mode 100644 (file)
index 0000000..7a11618
--- /dev/null
@@ -0,0 +1,105 @@
+From c8329f1bca61c203b48f80f01876384a79cceab5 Mon Sep 17 00:00:00 2001
+From: milde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
+Date: Sat, 14 May 2016 21:15:00 +0000
+Subject: [PATCH] Apply #131 (update pygments test to pygments 2.1) by
+ cstratak.
+
+git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7936 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
+---
+ .../test_parsers/test_rst/test_directives/test_code.py     |  6 +++---
+ .../test_rst/test_directives/test_code_long.py             |  2 +-
+ docutils/test/test_parsers/test_rst/test_interpreted.py    | 14 +++++++-------
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/test/test_parsers/test_rst/test_directives/test_code.py b/test/test_parsers/test_rst/test_directives/test_code.py
+index 5e013d4..8affcbe 100644
+--- a/test/test_parsers/test_rst/test_directives/test_code.py
++++ b/test/test_parsers/test_rst/test_directives/test_code.py
+@@ -107,10 +107,10 @@ totest['code-parsing'] = [
+         <inline classes="keyword">
+             print
+          \n\
+-        <inline classes="literal string">
++        <inline classes="literal string single">
+             'hello world'
+          \n\
+-        <inline classes="comment">
++        <inline classes="comment single">
+             # to stdout
+ """],
+ ["""\
+@@ -155,7 +155,7 @@ totest['code-parsing'] = [
+         <inline classes="ln">
+             11 \n\
+             \n\
+-        <inline classes="comment">
++        <inline classes="comment single">
+             # and now for something completely different
+         \n\
+         <inline classes="ln">
+diff --git a/test/test_parsers/test_rst/test_directives/test_code_long.py b/test/test_parsers/test_rst/test_directives/test_code_long.py
+index f015357..e6430cc 100644
+--- a/test/test_parsers/test_rst/test_directives/test_code_long.py
++++ b/test/test_parsers/test_rst/test_directives/test_code_long.py
+@@ -60,7 +60,7 @@ totest['code-parsing-long'] = [
+         <inline classes="ln">
+             11 \n\
+             \n\
+-        <inline classes="comment">
++        <inline classes="comment single">
+             # and now for something completely different
+         \n\
+         <inline classes="ln">
+diff --git a/test/test_parsers/test_rst/test_interpreted.py b/test/test_parsers/test_rst/test_interpreted.py
+index f9a1194..87d0a77 100755
+--- a/test/test_parsers/test_rst/test_interpreted.py
++++ b/test/test_parsers/test_rst/test_interpreted.py
+@@ -119,30 +119,30 @@ totest['basics'] = [
+         :not a role if it contains whitespace:
+ """],
+ ["""\
+-:title:`` (empty interpteted text not recognized)
++:title:`` (empty interpreted text not recognized)
+ """,
+ """\
+ <document source="test data">
+     <paragraph>
+-        :title:`` (empty interpteted text not recognized)
++        :title:`` (empty interpreted text not recognized)
+ """],
+ ["""\
+-:title:`\ ` (interpteted text containing empty string)
++:title:`\ ` (interpreted text containing empty string)
+ """,
+ """\
+ <document source="test data">
+     <paragraph>
+         <title_reference>
+-         (interpteted text containing empty string)
++         (interpreted text containing empty string)
+ """],
+ ["""\
+-`\ `:title: (interpteted text containing empty string (postfix))
++`\ `:title: (interpreted text containing empty string (postfix))
+ """,
+ """\
+ <document source="test data">
+     <paragraph>
+         <title_reference>
+-         (interpteted text containing empty string (postfix))
++         (interpreted text containing empty string (postfix))
+ """],
+ ["""\
+ :title:`\ non-empty`
+@@ -283,7 +283,7 @@ Python code :python:`print("The end")`.
+                 print
+             <inline classes="punctuation">
+                 (
+-            <inline classes="literal string">
++            <inline classes="literal string double">
+                 "The end"
+             <inline classes="punctuation">
+                 )
+-- 
+2.7.4.GIT
+
diff --git a/dev-python/docutils/files/docutils-0.12-fix-tests-pypy.patch b/dev-python/docutils/files/docutils-0.12-fix-tests-pypy.patch
new file mode 100644 (file)
index 0000000..7a29b88
--- /dev/null
@@ -0,0 +1,51 @@
+diff --git a/test/test_parsers/test_rst/test_directives/test_images.py b/test/test_parsers/test_rst/test_directives/test_images.py
+index ea3adfa..9743fba 100755
+--- a/test/test_parsers/test_rst/test_directives/test_images.py
++++ b/test/test_parsers/test_rst/test_directives/test_images.py
+@@ -277,7 +277,7 @@ totest['images'] = [
+         <literal_block xml:space="preserve">
+             .. image:: picture.png
+                :scale: fifty
+-""" % DocutilsTestSupport.exception_data(int, "fifty")[1][0]],
++""" % DocutilsTestSupport.exception_data(int, u"fifty")[1][0]],
+ ["""\
+ .. image:: picture.png
+    :scale: 50
+diff --git a/test/test_parsers/test_rst/test_directives/test_tables.py b/test/test_parsers/test_rst/test_directives/test_tables.py
+index 1200ab0..b75844a 100755
+--- a/test/test_parsers/test_rst/test_directives/test_tables.py
++++ b/test/test_parsers/test_rst/test_directives/test_tables.py
+@@ -12,6 +12,7 @@ from __init__ import DocutilsTestSupport
+ import os, sys
+ import csv
++import platform
+ from docutils.parsers.rst.directives import tables
+@@ -34,9 +35,14 @@ else:
+ # some error messages changed in Python 3.3:
+ csv_eod_error_str = 'unexpected end of data'
+-if sys.version_info < (3,2,4) and not (# backport to 2.7.4
+-    sys.version_info[:2] == (2,7) and sys.version_info[2] > 3):
++if sys.version_info < (3,2,4) and (
++    # CPython has backported to 2.7.4, PyPy has not
++    platform.python_implementation() == 'PyPy' or not (
++    sys.version_info[:2] == (2,7) and sys.version_info[2] > 3)):
+     csv_eod_error_str = 'newline inside string'
++# pypy adds a line number
++if platform.python_implementation() == 'PyPy':
++    csv_eod_error_str = 'line 1: ' + csv_eod_error_str
+ csv_unknown_url = "'bogus.csv'"
+ if sys.version_info < (3,3,2):
+     csv_unknown_url = "bogus.csv"
+@@ -782,7 +788,7 @@ u"""\
+                :widths: 0 0 0
+             \n\
+                some, csv, data
+-""" % DocutilsTestSupport.exception_data(int, "y")[1][0]],
++""" % DocutilsTestSupport.exception_data(int, u"y")[1][0]],
+ ["""\
+ .. csv-table:: good delimiter
+    :delim: /
index bd2a2f800ef5f2584be883857e012fb56de1f9b1..6ee5bb862e047fc8132f3881cdbc978f153a6e4c 100644 (file)
@@ -5,9 +5,6 @@
                <email>python@gentoo.org</email>
                <name>Python</name>
        </maintainer>
-       <use>
-               <flag name="glep">Install support for GLEPs</flag>
-       </use>
        <upstream>
                <remote-id type="sourceforge">docutils</remote-id>
        </upstream>