* [gentoo-commits] repo/gentoo:master commit in: dev-python/docutils/, dev-python/docutils/files/
@ 2016-10-19 16:32 Patrice Clement
0 siblings, 0 replies; 5+ messages in thread
From: Patrice Clement @ 2016-10-19 16:32 UTC (permalink / raw
To: gentoo-commits
commit: 37751f69b9bf96a30be87c43c4600d715953adf0
Author: Mathy Vanvoorden <mathy <AT> vanvoorden <DOT> be>
AuthorDate: Wed Oct 19 10:09:44 2016 +0000
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
CommitDate: Wed Oct 19 16:30:06 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37751f69
dev-python/docutils: major improvements.
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 <AT> vanvoorden.be>.
Package-Manager: portage-2.3.0
Closes: https://github.com/gentoo/gentoo/pull/2600
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
dev-python/docutils/Manifest | 3 -
...ocutils-0.10.ebuild => docutils-0.12-r1.ebuild} | 36 +++----
dev-python/docutils/docutils-0.9.1-r1.ebuild | 93 ------------------
.../docutils/files/docutils-0.10-optparser.patch | 34 -------
.../files/docutils-0.12-fix-tests-pygments.patch | 105 +++++++++++++++++++++
.../files/docutils-0.12-fix-tests-pypy.patch | 51 ++++++++++
dev-python/docutils/metadata.xml | 3 -
7 files changed, 176 insertions(+), 149 deletions(-)
diff --git a/dev-python/docutils/Manifest b/dev-python/docutils/Manifest
index 915b23b..5bf78ca 100644
--- a/dev-python/docutils/Manifest
+++ b/dev-python/docutils/Manifest
@@ -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
diff --git a/dev-python/docutils/docutils-0.10.ebuild b/dev-python/docutils/docutils-0.12-r1.ebuild
similarity index 59%
rename from dev-python/docutils/docutils-0.10.ebuild
rename to dev-python/docutils/docutils-0.12-r1.ebuild
index 15242cc..ff9e769 100644
--- a/dev-python/docutils/docutils-0.10.ebuild
+++ b/dev-python/docutils/docutils-0.12-r1.ebuild
@@ -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
index 5d8aaa8..00000000
--- a/dev-python/docutils/docutils-0.9.1-r1.ebuild
+++ /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
index 0e9f7ed..00000000
--- a/dev-python/docutils/files/docutils-0.10-optparser.patch
+++ /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
index 00000000..7a11618
--- /dev/null
+++ b/dev-python/docutils/files/docutils-0.12-fix-tests-pygments.patch
@@ -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
index 00000000..7a29b88
--- /dev/null
+++ b/dev-python/docutils/files/docutils-0.12-fix-tests-pypy.patch
@@ -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: /
diff --git a/dev-python/docutils/metadata.xml b/dev-python/docutils/metadata.xml
index bd2a2f8..6ee5bb8 100644
--- a/dev-python/docutils/metadata.xml
+++ b/dev-python/docutils/metadata.xml
@@ -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>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/docutils/, dev-python/docutils/files/
@ 2017-05-03 11:02 Michał Górny
0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2017-05-03 11:02 UTC (permalink / raw
To: gentoo-commits
commit: fdd20aa17dd7e5325bfca701adfb766ad880ae33
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 3 11:01:27 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 3 11:02:27 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fdd20aa1
dev-python/docutils: Clean old versions up
dev-python/docutils/docutils-0.12-r1.ebuild | 75 ---------------
.../files/docutils-0.12-fix-tests-pygments.patch | 105 ---------------------
.../files/docutils-0.12-fix-tests-pypy.patch | 51 ----------
3 files changed, 231 deletions(-)
diff --git a/dev-python/docutils/docutils-0.12-r1.ebuild b/dev-python/docutils/docutils-0.12-r1.ebuild
deleted file mode 100644
index fd90096d645..00000000000
--- a/dev-python/docutils/docutils-0.12-r1.ebuild
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy pypy3 )
-
-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"
-
-LICENSE="BSD-2 GPL-3 public-domain"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-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}"
-
-PATCHES=(
- # 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() {
- # 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
- "${EPYTHON}" buildhtml.py --input-encoding=utf-8 \
- --stylesheet-path=../html4css1.css, --traceback ../docs || die
-}
-
-python_test() {
- 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() {
- distutils-r1_python_install
-
- # Install tools.
- python_doscript tools/{buildhtml,quicktest}.py
-}
-
-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.12-fix-tests-pygments.patch b/dev-python/docutils/files/docutils-0.12-fix-tests-pygments.patch
deleted file mode 100644
index 7a116187d4c..00000000000
--- a/dev-python/docutils/files/docutils-0.12-fix-tests-pygments.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-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
deleted file mode 100644
index 7a29b885791..00000000000
--- a/dev-python/docutils/files/docutils-0.12-fix-tests-pypy.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-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: /
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/docutils/, dev-python/docutils/files/
@ 2022-05-14 8:25 Michał Górny
0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2022-05-14 8:25 UTC (permalink / raw
To: gentoo-commits
commit: 65f03f171fac890573267be3554f7256975a6b10
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May 14 07:50:52 2022 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May 14 08:25:50 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65f03f17
dev-python/docutils: Enable py3.11
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/docutils/docutils-0.17.1-r1.ebuild | 6 +-
dev-python/docutils/docutils-0.18.1-r1.ebuild | 6 +-
.../docutils/files/docutils-0.18.1-py311.patch | 135 +++++++++++++++++++++
3 files changed, 145 insertions(+), 2 deletions(-)
diff --git a/dev-python/docutils/docutils-0.17.1-r1.ebuild b/dev-python/docutils/docutils-0.17.1-r1.ebuild
index 5d0b53a49995..14547bfb4e2f 100644
--- a/dev-python/docutils/docutils-0.17.1-r1.ebuild
+++ b/dev-python/docutils/docutils-0.17.1-r1.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} pypy3 )
+PYTHON_COMPAT=( python3_{8..11} pypy3 )
inherit distutils-r1
@@ -26,6 +26,10 @@ BDEPEND="
${RDEPEND}
"
+PATCHES=(
+ "${FILESDIR}/docutils-0.18.1-py311.patch"
+)
+
python_compile_all() {
# Generate html docs from reStructured text sources.
diff --git a/dev-python/docutils/docutils-0.18.1-r1.ebuild b/dev-python/docutils/docutils-0.18.1-r1.ebuild
index 5d0b53a49995..14298078d9f9 100644
--- a/dev-python/docutils/docutils-0.18.1-r1.ebuild
+++ b/dev-python/docutils/docutils-0.18.1-r1.ebuild
@@ -4,7 +4,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{8..10} pypy3 )
+PYTHON_COMPAT=( python3_{8..11} pypy3 )
inherit distutils-r1
@@ -26,6 +26,10 @@ BDEPEND="
${RDEPEND}
"
+PATCHES=(
+ "${FILESDIR}/${P}-py311.patch"
+)
+
python_compile_all() {
# Generate html docs from reStructured text sources.
diff --git a/dev-python/docutils/files/docutils-0.18.1-py311.patch b/dev-python/docutils/files/docutils-0.18.1-py311.patch
new file mode 100644
index 000000000000..878c6f1961db
--- /dev/null
+++ b/dev-python/docutils/files/docutils-0.18.1-py311.patch
@@ -0,0 +1,135 @@
+Combination of:
+http://svn.code.sf.net/p/docutils/code/trunk@8910
+http://svn.code.sf.net/p/docutils/code/trunk@8909
+
+diff --git a/test/DocutilsTestSupport.py b/test/DocutilsTestSupport.py
+index 592d3f9df..e1f33aa7a 100644
+--- a/test/DocutilsTestSupport.py
++++ b/test/DocutilsTestSupport.py
+@@ -819,6 +819,7 @@ def exception_data(func, *args, **kwds):
+ except Exception as detail:
+ return (detail, detail.args,
+ '%s: %s' % (detail.__class__.__name__, detail))
++ return None, [], "No exception"
+
+
+ def _format_str(*args):
+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 07be0122f..73724ed7e 100755
+--- a/test/test_parsers/test_rst/test_directives/test_tables.py
++++ b/test/test_parsers/test_rst/test_directives/test_tables.py
+@@ -65,6 +65,92 @@ def null_bytes():
+ next(reader)
+
+ null_bytes_exception = DocutilsTestSupport.exception_data(null_bytes)[0]
++# Null bytes are valid in Python 3.11+:
++if null_bytes_exception is None:
++ bad_encoding_result = """\
++<document source="test data">
++ <table>
++ <title>
++ bad encoding
++ <tgroup cols="4">
++ <colspec colwidth="25">
++ <colspec colwidth="25">
++ <colspec colwidth="25">
++ <colspec colwidth="25">
++ <tbody>
++ <row>
++ <entry>
++ <paragraph>
++ \xfe\xff"Treat"
++ <entry>
++ <paragraph>
++ "Quantity"
++ <entry>
++ <paragraph>
++ "Description"
++ <entry>
++ <row>
++ <entry>
++ <paragraph>
++ "Albatr\u00b0\u00df"
++ <entry>
++ <paragraph>
++ 2.99
++ <entry>
++ <paragraph>
++ "\u00a1Ona\x03\xc3\x03\xc4\x03\xb9\x03\xba!"
++ <entry>
++ <row>
++ <entry>
++ <paragraph>
++ "CrunchyFrog"
++ <entry>
++ <paragraph>
++ 1.49
++ <entry>
++ <paragraph>
++ "Ifwetooktheb\u00f6nesout
++ <entry>
++ <paragraph>
++ itwouldn\x20\x19tbe
++ <row>
++ <entry>
++ <paragraph>
++ crunchy
++ <entry>
++ <paragraph>
++ nowwouldit?"
++ <entry>
++ <entry>
++ <row>
++ <entry>
++ <paragraph>
++ "GannetRipple"
++ <entry>
++ <paragraph>
++ 1.99
++ <entry>
++ <paragraph>
++ "\xbfOna\x03\xc3\x03\xc4\x03\xb9\x03\xba?"
++ <entry>
++ <paragraph>
++ (7- and 8-bit text encoded as UTF-16 has lots of null/zero bytes.)
++"""
++else:
++ bad_encoding_result = """\
++<document source="test data">
++ <system_message level="3" line="1" source="test data" type="ERROR">
++ <paragraph>
++ Error with CSV data in "csv-table" directive:
++ %s
++ <literal_block xml:space="preserve">
++ .. csv-table:: bad encoding
++ :file: %s
++ :encoding: latin-1
++ <paragraph>
++ (7- and 8-bit text encoded as UTF-16 has lots of null/zero bytes.)
++""" % (null_bytes_exception, utf_16_csv)
++
+
+ totest = {}
+
+@@ -1031,19 +1117,8 @@ u"""\
+
+ (7- and 8-bit text encoded as UTF-16 has lots of null/zero bytes.)
+ """ % utf_16_csv,
+-"""\
+-<document source="test data">
+- <system_message level="3" line="1" source="test data" type="ERROR">
+- <paragraph>
+- Error with CSV data in "csv-table" directive:
+- %s
+- <literal_block xml:space="preserve">
+- .. csv-table:: bad encoding
+- :file: %s
+- :encoding: latin-1
+- <paragraph>
+- (7- and 8-bit text encoded as UTF-16 has lots of null/zero bytes.)
+-""" % (null_bytes_exception, utf_16_csv)],
++bad_encoding_result
++],
+ ["""\
+ .. csv-table:: good encoding
+ :file: %s
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/docutils/, dev-python/docutils/files/
@ 2023-02-08 2:59 Sam James
0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2023-02-08 2:59 UTC (permalink / raw
To: gentoo-commits
commit: 351aed9ae8ec5aadb9d59c0cf3cc4bf5c05eecb6
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 8 02:58:42 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 8 02:58:42 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=351aed9a
dev-python/docutils: fix tests w/ pygments-2.14.0
Closes: https://bugs.gentoo.org/892213
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-python/docutils/docutils-0.19.ebuild | 4 +
.../files/docutils-0.19-pygments-2.14.patch | 672 +++++++++++++++++++++
2 files changed, 676 insertions(+)
diff --git a/dev-python/docutils/docutils-0.19.ebuild b/dev-python/docutils/docutils-0.19.ebuild
index 0a5fd76f32d2..b97ed0c05eff 100644
--- a/dev-python/docutils/docutils-0.19.ebuild
+++ b/dev-python/docutils/docutils-0.19.ebuild
@@ -26,6 +26,10 @@ BDEPEND="
${RDEPEND}
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.19-pygments-2.14.patch
+)
+
python_compile_all() {
# Generate html docs from reStructured text sources.
diff --git a/dev-python/docutils/files/docutils-0.19-pygments-2.14.patch b/dev-python/docutils/files/docutils-0.19-pygments-2.14.patch
new file mode 100644
index 000000000000..42324aa49c4d
--- /dev/null
+++ b/dev-python/docutils/files/docutils-0.19-pygments-2.14.patch
@@ -0,0 +1,672 @@
+https://bugs.gentoo.org/892213
+https://sourceforge.net/p/docutils/patches/201/
+--- a/test/test_parsers/test_rst/test_directives/test_code.py
++++ b/test/test_parsers/test_rst/test_directives/test_code.py
+@@ -10,14 +10,20 @@ Test the 'code' directive in parsers/rst
+
+ if __name__ == '__main__':
+ import __init__ # noqa: F401
++from packaging.version import Version
+ from test_parsers import DocutilsTestSupport
+-from docutils.utils.code_analyzer import with_pygments
++from docutils.utils.code_analyzer import with_pygments, pygments_version
+
+
+ def suite():
+ s = DocutilsTestSupport.ParserTestSuite()
+ if not with_pygments:
+ del(totest['code-parsing'])
++ del(totest['code-parsing-2-14'])
++ elif pygments_version >= Version('2.14.0'):
++ del(totest['code-parsing'])
++ else:
++ del(totest['code-parsing-2-14'])
+ s.generateTests(totest)
+ return s
+
+@@ -170,6 +176,165 @@ totest['code-parsing'] = [
+ \n\
+ <inline classes="name builtin">
+ print
++ <inline classes="punctuation">
++ (
++ <inline classes="literal number integer">
++ 8
++ <inline classes="operator">
++ /
++ <inline classes="literal number integer">
++ 2
++ <inline classes="punctuation">
++ )
++"""],
++["""\
++.. code:: latex
++ :class: testclass
++
++ hello \\emph{world} % emphasize
++""",
++"""\
++<document source="test data">
++ <literal_block classes="code latex testclass" xml:space="preserve">
++ hello \n\
++ <inline classes="keyword">
++ \\emph
++ <inline classes="name builtin">
++ {
++ world
++ <inline classes="name builtin">
++ }
++ \n\
++ <inline classes="comment">
++ % emphasize"""],
++["""\
++.. code:: rst
++ :number-lines:
++
++ This is a code block with text.
++""",
++"""\
++<document source="test data">
++ <literal_block classes="code rst" xml:space="preserve">
++ <inline classes="ln">
++ 1 \n\
++ This is a code block with text.
++"""],
++["""\
++Code not parsed but warning silenced in ParserTestCase.
++
++.. code:: s-lang
++
++ % abc.sl
++ autoload("abc_mode", "abc");
++""",
++"""\
++<document source="test data">
++ <paragraph>
++ Code not parsed but warning silenced in ParserTestCase.
++ <literal_block classes="code s-lang" xml:space="preserve">
++ % abc.sl
++ autoload("abc_mode", "abc");
++"""],
++["""\
++Place the language name in a class argument to avoid the no-lexer warning:
++
++.. code::
++ :class: s-lang
++
++ % abc.sl
++ autoload("abc_mode", "abc");
++""",
++"""\
++<document source="test data">
++ <paragraph>
++ Place the language name in a class argument to avoid the no-lexer warning:
++ <literal_block classes="code s-lang" xml:space="preserve">
++ % abc.sl
++ autoload("abc_mode", "abc");
++"""],
++]
++
++totest['code-parsing-2-14'] = [
++["""\
++.. code:: python3
++ :class: testclass
++
++ print('hello world') # to stdout
++""",
++"""\
++<document source="test data">
++ <literal_block classes="code python3 testclass" xml:space="preserve">
++ \n\
++ <inline classes="name builtin">
++ print
++ <inline classes="punctuation">
++ (
++ <inline classes="literal string single">
++ 'hello world'
++ <inline classes="punctuation">
++ )
++ \n\
++ <inline classes="comment single">
++ # to stdout
++"""],
++["""\
++.. code:: python3
++ :class: testclass
++ :name: my_function
++ :number-lines: 7
++
++ def my_function():
++ '''Test the lexer.
++ '''
++
++ # and now for something completely different
++ print(8/2)
++""",
++"""\
++<document source="test data">
++ <literal_block classes="code python3 testclass" ids="my-function" names="my_function" xml:space="preserve">
++ <inline classes="ln">
++ 7 \n\
++ <inline classes="keyword">
++ def
++ \n\
++ <inline classes="name function">
++ my_function
++ <inline classes="punctuation">
++ ():
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 8 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="literal string doc">
++ \'\'\'Test the lexer.
++ <inline classes="ln">
++ 9 \n\
++ <inline classes="literal string doc">
++ \'\'\'
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 10 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 11 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="comment single">
++ # and now for something completely different
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 12 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="name builtin">
++ print
+ <inline classes="punctuation">
+ (
+ <inline classes="literal number integer">
+--- a/test/test_parsers/test_rst/test_directives/test_code_long.py
++++ b/test/test_parsers/test_rst/test_directives/test_code_long.py
+@@ -10,15 +10,22 @@ Test the 'code' directive in body.py wit
+
+ if __name__ == '__main__':
+ import __init__ # noqa: F401
++from packaging.version import Version
+ from test_parsers import DocutilsTestSupport
+-from docutils.utils.code_analyzer import with_pygments
++from docutils.utils.code_analyzer import with_pygments, pygments_version
+
+
+ def suite():
+ settings = {'syntax_highlight': 'long'}
+ s = DocutilsTestSupport.ParserTestSuite(suite_settings=settings)
+ if with_pygments:
++ if pygments_version >= Version('2.14.0'):
++ del(totest['code-parsing-long'])
++ else:
++ del(totest['code-parsing-long-2-14'])
++
+ s.generateTests(totest)
++
+ return s
+
+
+@@ -73,6 +80,94 @@ totest['code-parsing-long'] = [
+ \n\
+ <inline classes="name builtin">
+ print
++ <inline classes="punctuation">
++ (
++ <inline classes="literal number integer">
++ 8
++ <inline classes="operator">
++ /
++ <inline classes="literal number integer">
++ 2
++ <inline classes="punctuation">
++ )
++"""],
++["""\
++.. code:: latex
++
++ hello \\emph{world} % emphasize
++""",
++"""\
++<document source="test data">
++ <literal_block classes="code latex" xml:space="preserve">
++ hello \n\
++ <inline classes="keyword">
++ \\emph
++ <inline classes="name builtin">
++ {
++ world
++ <inline classes="name builtin">
++ }
++ \n\
++ <inline classes="comment">
++ % emphasize"""],
++]
++
++totest['code-parsing-long-2-14'] = [
++["""\
++.. code:: python3
++ :number-lines: 7
++
++ def my_function():
++ '''Test the lexer.
++ '''
++
++ # and now for something completely different
++ print(8/2)
++""",
++"""\
++<document source="test data">
++ <literal_block classes="code python3" xml:space="preserve">
++ <inline classes="ln">
++ 7 \n\
++ <inline classes="keyword">
++ def
++ \n\
++ <inline classes="name function">
++ my_function
++ <inline classes="punctuation">
++ ():
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 8 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="literal string doc">
++ \'\'\'Test the lexer.
++ <inline classes="ln">
++ 9 \n\
++ <inline classes="literal string doc">
++ \'\'\'
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 10 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 11 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="comment single">
++ # and now for something completely different
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 12 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="name builtin">
++ print
+ <inline classes="punctuation">
+ (
+ <inline classes="literal number integer">
+--- a/test/test_parsers/test_rst/test_directives/test_include.py
++++ b/test/test_parsers/test_rst/test_directives/test_include.py
+@@ -10,9 +10,10 @@ Tests for misc.py "include" directive.
+ import os.path
+ if __name__ == '__main__':
+ import __init__ # noqa: F401
++from packaging.version import Version
+ from test_parsers import DocutilsTestSupport
+ from docutils import parsers
+-from docutils.utils.code_analyzer import with_pygments
++from docutils.utils.code_analyzer import with_pygments, pygments_version
+
+ # optional 3rd-party markdown parser
+ md_parser_name = 'recommonmark'
+@@ -27,6 +28,11 @@ def suite():
+ # eventually skip optional parts:
+ if not with_pygments:
+ del(totest['include-code'])
++ del(totest['include-code-2-14'])
++ elif pygments_version >= Version('2.14.0'):
++ del(totest['include-code'])
++ else:
++ del(totest['include-code-2-14'])
+ if not md_parser_class:
+ del(totest['include-markdown'])
+ s.generateTests(totest)
+@@ -1191,6 +1197,313 @@ Including includes/include14.txt
+ <inline classes="punctuation">
+ ..
+ \n\
++ <inline classes="operator word">
++ include
++ <inline classes="punctuation">
++ ::
++ ../sibling/include7.txt
++""" % reldir(include6)],
++["""\
++Circular inclusion
++
++.. include:: %s
++""" % include15,
++"""\
++<document source="test data">
++ <paragraph>
++ Circular inclusion
++ <paragraph>
++ File "include15.txt": example of rekursive inclusion.
++ <paragraph>
++ File "include16.txt": example of rekursive inclusion.
++ <system_message level="2" line="3" source="%s" type="WARNING">
++ <paragraph>
++ circular inclusion in "include" directive:
++ %s
++ > %s
++ > %s
++ > test data
++ <literal_block xml:space="preserve">
++ .. include:: include15.txt
++ <paragraph>
++ No loop when clipping before the "include" directive:
++ <paragraph>
++ File "include15.txt": example of rekursive inclusion.
++""" % (reldir(include16), reldir(include15),
++ reldir(include16), reldir(include15))],
++["""\
++Circular inclusion with clipping.
++
++.. include:: %s
++ :start-line: 2
++""" % include16,
++"""\
++<document source="test data">
++ <paragraph>
++ Circular inclusion with clipping.
++ <paragraph>
++ File "include15.txt": example of rekursive inclusion.
++ <paragraph>
++ File "include16.txt": example of rekursive inclusion.
++ <system_message level="2" line="3" source="%s" type="WARNING">
++ <paragraph>
++ circular inclusion in "include" directive:
++ %s
++ > %s
++ > %s
++ > %s
++ > test data
++ <literal_block xml:space="preserve">
++ .. include:: include15.txt
++ <paragraph>
++ No loop when clipping before the "include" directive:
++ <paragraph>
++ File "include15.txt": example of rekursive inclusion.
++ <paragraph>
++ No loop when clipping before the "include" directive:
++ <paragraph>
++ File "include15.txt": example of rekursive inclusion.
++""" % (reldir(include16), reldir(include15), reldir(include16),
++ reldir(include15), reldir(include16))],
++["""\
++Circular inclusion with specified parser.
++
++.. include:: %s
++ :parser: rst
++""" % include15,
++"""\
++<document source="test data">
++ <paragraph>
++ Circular inclusion with specified parser.
++ <paragraph>
++ File "include15.txt": example of rekursive inclusion.
++ <paragraph>
++ File "include16.txt": example of rekursive inclusion.
++ <system_message level="2" line="3" source="%s" type="WARNING">
++ <paragraph>
++ circular inclusion in "include" directive:
++ %s
++ > %s
++ > %s
++ > test data
++ <literal_block xml:space="preserve">
++ .. include:: include15.txt
++ <paragraph>
++ No loop when clipping before the "include" directive:
++ <paragraph>
++ File "include15.txt": example of rekursive inclusion.
++""" % (reldir(include16), reldir(include15),
++ reldir(include16), reldir(include15))],
++["""\
++No circular inclusion.
++
++============================= =============================
++.. include:: data/include.txt .. include:: data/include.txt
++============================= =============================
++""",
++"""\
++<document source="test data">
++ <paragraph>
++ No circular inclusion.
++ <table>
++ <tgroup cols="2">
++ <colspec colwidth="29">
++ <colspec colwidth="29">
++ <tbody>
++ <row>
++ <entry>
++ <paragraph>
++ Some include text.
++ <entry>
++ <paragraph>
++ Some include text."""],
++]
++
++totest['include-code-2-14'] = [
++["""\
++Included code
++
++.. include:: %s
++ :code: rst
++""" % include1,
++"""\
++<document source="test data">
++ <paragraph>
++ Included code
++ <literal_block classes="code rst" source="%s" xml:space="preserve">
++ <inline classes="generic heading">
++ Inclusion 1
++ \n\
++ <inline classes="generic heading">
++ -----------
++ \n\
++ <inline classes="whitespace">
++ \n\
++ This file is used by \n\
++ <inline classes="literal string">
++ ``test_include.py``
++ .
++""" % reldir(include1)],
++["""\
++Included code
++
++.. include:: %s
++ :code: rst
++ :number-lines:
++""" % include1,
++"""\
++<document source="test data">
++ <paragraph>
++ Included code
++ <literal_block classes="code rst" source="%s" xml:space="preserve">
++ <inline classes="ln">
++ 1 \n\
++ <inline classes="generic heading">
++ Inclusion 1
++ \n\
++ <inline classes="ln">
++ 2 \n\
++ <inline classes="generic heading">
++ -----------
++ \n\
++ <inline classes="ln">
++ 3 \n\
++ <inline classes="whitespace">
++ \n\
++ <inline classes="ln">
++ 4 \n\
++ <inline classes="whitespace">
++ This file is used by \n\
++ <inline classes="literal string">
++ ``test_include.py``
++ .
++""" % reldir(include1)],
++["""\
++TAB expansion with included code:
++
++.. include:: %s
++ :code: rst
++""" % include_literal,
++"""\
++<document source="test data">
++ <paragraph>
++ TAB expansion with included code:
++ <literal_block classes="code rst" source="%s" xml:space="preserve">
++ Literal included this should \n\
++ <inline classes="generic strong">
++ **not**
++ be \n\
++ <inline classes="generic emph">
++ *marked*
++ \n\
++ <inline classes="name variable">
++ `up`
++ .
++ <inline classes="whitespace">
++ \n\
++ <- leading raw tab.
++ <inline classes="whitespace">
++ \n\
++ \n\
++ Newlines
++ <inline classes="whitespace">
++ \n\
++ are
++ <inline classes="whitespace">
++ \n\
++ normalized.
++""" % include_literal],
++["""\
++Custom TAB expansion with included code:
++
++.. include:: %s
++ :code: rst
++ :tab-width: 2
++""" % include_literal,
++"""\
++<document source="test data">
++ <paragraph>
++ Custom TAB expansion with included code:
++ <literal_block classes="code rst" source="%s" xml:space="preserve">
++ Literal included this should \n\
++ <inline classes="generic strong">
++ **not**
++ be \n\
++ <inline classes="generic emph">
++ *marked*
++ \n\
++ <inline classes="name variable">
++ `up`
++ .
++ <inline classes="whitespace">
++ \n\
++ <- leading raw tab.
++ <inline classes="whitespace">
++ \n\
++ \n\
++ Newlines
++ <inline classes="whitespace">
++ \n\
++ are
++ <inline classes="whitespace">
++ \n\
++ normalized.
++""" % include_literal],
++["""\
++Custom TAB expansion with included code:
++
++.. include:: %s
++ :code: rst
++ :tab-width: -1
++""" % include_literal,
++"""\
++<document source="test data">
++ <paragraph>
++ Custom TAB expansion with included code:
++ <literal_block classes="code rst" source="%s" xml:space="preserve">
++ Literal included this should \n\
++ <inline classes="generic strong">
++ **not**
++ be \n\
++ <inline classes="generic emph">
++ *marked*
++ \n\
++ <inline classes="name variable">
++ `up`
++ .
++ <inline classes="whitespace">
++ \n\
++ \t<- leading raw tab.
++ <inline classes="whitespace">
++ \n\
++ \n\
++ Newlines
++ <inline classes="whitespace">
++ \n\
++ are
++ <inline classes="whitespace">
++ \n\
++ normalized.
++""" % include_literal],
++["""\
++Including includes/include14.txt
++
++.. include:: %s
++""" % include14,
++"""\
++<document source="test data">
++ <paragraph>
++ Including includes/include14.txt
++ <paragraph>
++ Including more/include6.txt as rst-code from includes/include14.txt:
++ <literal_block classes="code rst" source="%s" xml:space="preserve">
++ In includes/more/include6.txt
++ <inline classes="whitespace">
++ \n\
++ \n\
++ <inline classes="punctuation">
++ ..
++ \n\
+ <inline classes="operator word">
+ include
+ <inline classes="punctuation">
+--- a/docutils/utils/code_analyzer.py
++++ b/docutils/utils/code_analyzer.py
+@@ -9,11 +9,14 @@
+ from docutils import ApplicationError
+ try:
+ import pygments
++ from packaging.version import Version
+ from pygments.lexers import get_lexer_by_name
+ from pygments.formatters.html import _get_ttype_class
+ with_pygments = True
++ pygments_version = Version(pygments.__version__)
+ except ImportError:
+ with_pygments = False
++ pygments_version = '0'
+
+ # Filter the following token types from the list of class arguments:
+ unstyled_tokens = ['token', # Token (base token type)
+
+
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/docutils/, dev-python/docutils/files/
@ 2024-04-13 9:45 Michał Górny
0 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2024-04-13 9:45 UTC (permalink / raw
To: gentoo-commits
commit: 13dd8db9617ea3013e152d1be0438117b5357dd9
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 13 09:45:25 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Apr 13 09:45:46 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13dd8db9
dev-python/docutils: Bump to 0.21.1
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/docutils/Manifest | 1 +
dev-python/docutils/docutils-0.21.1.ebuild | 86 ++++++++++++++++++++++
.../docutils/files/docutils-0.21.1-test.patch | 42 +++++++++++
3 files changed, 129 insertions(+)
diff --git a/dev-python/docutils/Manifest b/dev-python/docutils/Manifest
index 1b240bf273a9..520c7d2dd766 100644
--- a/dev-python/docutils/Manifest
+++ b/dev-python/docutils/Manifest
@@ -1,2 +1,3 @@
DIST docutils-0.19.tar.gz 2056383 BLAKE2B 9983a905642de4e81ca118578671b503ddfda4bef1afcc0524de40543e1f9617fd8d768ef467da49d2f01076683400bad6a0fe15f6b5a3a1e202c42b2e34ab1b SHA512 fb904a899f2b6f3c07c5079577bd7c52a3182cb85f6a4149391e523498df15bfa317f0c04095b890beeb3f89c2b444875a2a609d880ac4d7fbc3125e46b37ea5
DIST docutils-0.20.1.tar.gz 2058365 BLAKE2B 73fb8302599ffe57b0840c898b0b2e3ccd39ff9ea6eec2b5d345d02c950e1a8357bd821e62733b0484e82bc30e71d30fab381390b0edaef4375b02bcd9eeeb40 SHA512 a0ddca315d03677003036d6a8052ac96fbd3fcc4508564938ea684d79bedb4d322d83449c7b26e55b19b0aadd6e46ca9ac409bb16279a20f06c70e9c15ef5eb0
+DIST docutils-0.21.1.tar.gz 2201080 BLAKE2B a89792a69a7faa0eda7b2470e5e3a3d3cf8250a3577553a8f8f8d3d86d2693394e97dca6c75c1b4815748d2ce126ccd3f71dead5763ec8b70aee7be183165473 SHA512 2816fe074b12d7f15fb6730339f3af5f459f50af0cd2a4922194887f48bfd9931c2f2054a17a5418585b586502b96e05ed18600d31c523084537dc72707ab0ee
diff --git a/dev-python/docutils/docutils-0.21.1.ebuild b/dev-python/docutils/docutils-0.21.1.ebuild
new file mode 100644
index 000000000000..773ff8bded58
--- /dev/null
+++ b/dev-python/docutils/docutils-0.21.1.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=flit
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+
+inherit distutils-r1 optfeature pypi
+
+DESCRIPTION="Python Documentation Utilities (reference reStructuredText impl.)"
+HOMEPAGE="
+ https://docutils.sourceforge.io/
+ https://pypi.org/project/docutils/
+"
+
+# GPL-3+ only for emacs/rst.el
+LICENSE="BSD BSD-2 GPL-3+ PSF-2.4 public-domain"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+
+RDEPEND="
+ dev-python/pillow[${PYTHON_USEDEP}]
+ dev-python/pygments[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ ${RDEPEND}
+"
+
+PATCHES=(
+ # minimal backport of upstream r9637, r9641
+ "${FILESDIR}/${P}-test.patch"
+)
+
+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
+ "${EPYTHON}" buildhtml.py --input-encoding=utf-8 --no-datestamp \
+ --stylesheet-path=../html4css1.css, --traceback ../docs || die
+}
+
+src_test() {
+ cd test || die
+ mkdir functional/output || die
+ distutils-r1_src_test
+}
+
+python_test() {
+ "${EPYTHON}" alltests.py -v || die "Testing failed with ${EPYTHON}"
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ # Install tools.
+ python_doscript tools/buildhtml.py
+}
+
+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)
+}
+
+pkg_postinst() {
+ optfeature \
+ "auto-detecting the image dimensions when using the 'scale' option" \
+ dev-python/pillow
+}
diff --git a/dev-python/docutils/files/docutils-0.21.1-test.patch b/dev-python/docutils/files/docutils-0.21.1-test.patch
new file mode 100644
index 000000000000..507fd239c166
--- /dev/null
+++ b/dev-python/docutils/files/docutils-0.21.1-test.patch
@@ -0,0 +1,42 @@
+diff --git a/test/test_writers/test_html5_polyglot_parts.py b/test/test_writers/test_html5_polyglot_parts.py
+index fb2792ee7..cb03fea2f 100644
+--- a/test/test_writers/test_html5_polyglot_parts.py
++++ b/test/test_writers/test_html5_polyglot_parts.py
+@@ -24,11 +24,20 @@ if __name__ == '__main__':
+
+ import docutils
+ import docutils.core
++from docutils.parsers.rst.directives.images import PIL
+ from docutils.utils.code_analyzer import with_pygments
+
+ ROOT_PREFIX = (Path(__file__).parent.parent/'functional'/'input').as_posix()
+ DATA_ROOT = os.path.abspath(os.path.join(__file__, '..', '..', 'data'))
+
++with_pygments = False
++PIL_NOT_FOUND_PATH = 'dummy.png'
++try:
++ if PIL and (tuple(int(i) for i in PIL.__version__.split('.')) >= (10, 3)):
++ PIL_NOT_FOUND_PATH = Path('dummy.png').resolve()
++except:
++ PIL = None
++
+
+ class Html5WriterPublishPartsTestCase(unittest.TestCase):
+ """Test case for HTML writer via the publish_parts interface."""
+@@ -642,14 +651,14 @@ totest['system_messages'] = ({'stylesheet_path': '',
+ .. image:: dummy.mp4
+ :scale: 100%
+ """,
+-{'fragment': """\
++{'fragment': f"""\
+ <img alt="dummy.png" src="dummy.png" />
+ <aside class="system-message">
+ <p class="system-message-title">System Message: WARNING/2 \
+ (<span class="docutils literal"><string></span>, line 1)</p>
+ <p>Cannot scale image!
+ Could not get size from "dummy.png":
+- [Errno 2] No such file or directory: 'dummy.png'</p>
++ [Errno 2] No such file or directory: '{PIL_NOT_FOUND_PATH}'</p>
+ </aside>
+ <aside class="system-message">
+ <p class="system-message-title">System Message: ERROR/3 \
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-04-13 9:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-08 2:59 [gentoo-commits] repo/gentoo:master commit in: dev-python/docutils/, dev-python/docutils/files/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-04-13 9:45 Michał Górny
2022-05-14 8:25 Michał Górny
2017-05-03 11:02 Michał Górny
2016-10-19 16:32 Patrice Clement
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox