mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-29 01:21:02 +02:00
dev-python/docutils: Sync with Gentoo
It's from Gentoo commit 107d39ef65230c527b91e45bf87924b5989d3650.
This commit is contained in:
parent
b6c701539d
commit
95fea4f4ce
@ -1,3 +1,2 @@
|
||||
DIST docutils-0.17.1.tar.gz 2016138 BLAKE2B aa0b6525ba2e3eaebc17010806952ed5f40919876fcb813f50cc05b628dfd22e6073a9a4b2bfe989089ae68d9b7111ae3a97dda2bde5c0536f8fb76c0942fe29 SHA512 5ec2087116bd5356fdffc54f07f6b0355aac5fa9d6caeefa77e8d201fd4706c0d419193c4d9a3964ae493da3091fe2c7dc36b74f81a1e1b9282173658b06e71b
|
||||
DIST docutils-0.19.tar.gz 2056383 BLAKE2B 9983a905642de4e81ca118578671b503ddfda4bef1afcc0524de40543e1f9617fd8d768ef467da49d2f01076683400bad6a0fe15f6b5a3a1e202c42b2e34ab1b SHA512 fb904a899f2b6f3c07c5079577bd7c52a3182cb85f6a4149391e523498df15bfa317f0c04095b890beeb3f89c2b444875a2a609d880ac4d7fbc3125e46b37ea5
|
||||
DIST docutils-0.20.1.tar.gz 2058365 BLAKE2B 73fb8302599ffe57b0840c898b0b2e3ccd39ff9ea6eec2b5d345d02c950e1a8357bd821e62733b0484e82bc30e71d30fab381390b0edaef4375b02bcd9eeeb40 SHA512 a0ddca315d03677003036d6a8052ac96fbd3fcc4508564938ea684d79bedb4d322d83449c7b26e55b19b0aadd6e46ca9ac409bb16279a20f06c70e9c15ef5eb0
|
||||
|
@ -1,76 +0,0 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{9..11} pypy3 )
|
||||
|
||||
inherit distutils-r1 pypi
|
||||
|
||||
DESCRIPTION="Python Documentation Utilities (reference reStructuredText impl.)"
|
||||
HOMEPAGE="
|
||||
https://docutils.sourceforge.io/
|
||||
https://pypi.org/project/docutils/
|
||||
"
|
||||
|
||||
LICENSE="BSD-2 GPL-3 public-domain"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
|
||||
|
||||
RDEPEND="
|
||||
dev-python/pygments[${PYTHON_USEDEP}]
|
||||
"
|
||||
BDEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/docutils-0.18.1-py311.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
|
||||
}
|
||||
|
||||
src_test() {
|
||||
cd test || 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,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)
|
||||
}
|
@ -1,135 +0,0 @@
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user