From 44c052714034d45b24021da0dee21baf57e217e0 Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 16 Jun 2025 07:08:39 +0000 Subject: [PATCH] dev-python/docutils: Sync with Gentoo It's from Gentoo commit 1ce59387551f21e849b9da8659dd78f2c97471c7. --- .../dev-python/docutils/Manifest | 2 + .../docutils/docutils-0.21.2.ebuild | 10 +- .../docutils/docutils-0.22_rc2.ebuild | 61 ++++++++++ .../docutils/docutils-0.22_rc3.ebuild | 61 ++++++++++ .../files/docutils-0.21.2-pillow.patch | 15 +++ .../files/docutils-0.21.2-pygments-2.19.patch | 106 ++++++++++++++++++ 6 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.22_rc2.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.22_rc3.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/dev-python/docutils/files/docutils-0.21.2-pillow.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-python/docutils/files/docutils-0.21.2-pygments-2.19.patch diff --git a/sdk_container/src/third_party/portage-stable/dev-python/docutils/Manifest b/sdk_container/src/third_party/portage-stable/dev-python/docutils/Manifest index 45a41f2110..0bc139545c 100644 --- a/sdk_container/src/third_party/portage-stable/dev-python/docutils/Manifest +++ b/sdk_container/src/third_party/portage-stable/dev-python/docutils/Manifest @@ -1 +1,3 @@ DIST docutils-0.21.2.tar.gz 2204444 BLAKE2B 727c2f97fc5835a0ffa62e38ea85af366cd89ad1eaec0b8af8b1f3b12e6cddfddb65161ba34f9109952d37ba2cf8985f3c3b6905ebb2ac1c9a984cce3fb4d170 SHA512 7fafa331f5687448e80d299c20cdccc4b49819fa471b5f586bf0ab18c694ba43a70f58e7c76b0a70a16267585548389214e11a4998ad7fdc19a27f0f7644539c +DIST docutils-0.22rc2.tar.gz 2275875 BLAKE2B 62140304e9715e31d8be69c9b65fa382832805368cbf3c184b6319405f22d6c05a16b3b28b5444b4e498c21f4bb7baee8520ef80b445123341aaab7a6a6965d6 SHA512 fcb347d29315a5c2e9f070057962094457bdaf08693c1393a649ae24bab572be027c253deb98561c5cd5a27f2d1f994cf7dea63d0cb74c3a3993c4cea45e0a48 +DIST docutils-0.22rc3.tar.gz 2278230 BLAKE2B 650373b87230bc376c785becfbe2d61e2d67e561facd364f877bd580113223e39b42053b1b5fcab09990f0fc0be9f7aebaff0fc5fdb4fd524e6f45bc4de34a89 SHA512 7fa2cdceb818a69bc1b52ee16680ce23f9d15dc51b684097b479204611e2b320d778e32d5494f88543d77bc1424ee04628680610ed2dc1f5c0798a18b8da5cbd diff --git a/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.21.2.ebuild b/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.21.2.ebuild index e7e5589f3b..c4b7480a28 100644 --- a/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.21.2.ebuild +++ b/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.21.2.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=flit -PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 ) +PYTHON_COMPAT=( python3_{11..14} pypy3_11 ) inherit distutils-r1 pypi @@ -27,6 +27,14 @@ BDEPEND=" ${RDEPEND} " +PATCHES=( + # r10019 upstream + "${FILESDIR}/${P}-pygments-2.19.patch" + # this changed back at some point, but upstream didn't hit it + # because of https://sourceforge.net/p/docutils/bugs/500/ + "${FILESDIR}/${P}-pillow.patch" +) + python_compile_all() { # Generate html docs from reStructured text sources. diff --git a/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.22_rc2.ebuild b/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.22_rc2.ebuild new file mode 100644 index 0000000000..d5ea86951e --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.22_rc2.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=flit +PYTHON_COMPAT=( python3_{11..14} pypy3_11 ) + +inherit distutils-r1 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" + +RDEPEND=" + dev-python/pillow[${PYTHON_USEDEP}] + dev-python/pygments[${PYTHON_USEDEP}] +" +BDEPEND=" + ${RDEPEND} +" + +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 + 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 +} + +python_install_all() { + local DOCS=( *.rst ) + local HTML_DOCS=( docs tools docutils/writers/html4css1/html4css1.css ) + + distutils-r1_python_install_all +} diff --git a/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.22_rc3.ebuild b/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.22_rc3.ebuild new file mode 100644 index 0000000000..d5ea86951e --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-python/docutils/docutils-0.22_rc3.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=flit +PYTHON_COMPAT=( python3_{11..14} pypy3_11 ) + +inherit distutils-r1 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" + +RDEPEND=" + dev-python/pillow[${PYTHON_USEDEP}] + dev-python/pygments[${PYTHON_USEDEP}] +" +BDEPEND=" + ${RDEPEND} +" + +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 + 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 +} + +python_install_all() { + local DOCS=( *.rst ) + local HTML_DOCS=( docs tools docutils/writers/html4css1/html4css1.css ) + + distutils-r1_python_install_all +} diff --git a/sdk_container/src/third_party/portage-stable/dev-python/docutils/files/docutils-0.21.2-pillow.patch b/sdk_container/src/third_party/portage-stable/dev-python/docutils/files/docutils-0.21.2-pillow.patch new file mode 100644 index 0000000000..993283ed79 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-python/docutils/files/docutils-0.21.2-pillow.patch @@ -0,0 +1,15 @@ +diff --git a/test/test_writers/test_html5_polyglot_parts.py b/test/test_writers/test_html5_polyglot_parts.py +index 7122f8469..749f541e4 100644 +--- a/test/test_writers/test_html5_polyglot_parts.py ++++ b/test/test_writers/test_html5_polyglot_parts.py +@@ -43,10 +43,6 @@ if PIL: + REQUIRES_PIL = '' + ONLY_LOCAL = 'Can only read local images.' + DUMMY_PNG_NOT_FOUND = "[Errno 2] No such file or directory: 'dummy.png'" +- # Pillow reports the absolute path since version 10.3.0 (cf. [bugs: 485]) +- if (tuple(int(i) for i in PIL.__version__.split('.')) >= (10, 3)): +- DUMMY_PNG_NOT_FOUND = ("[Errno 2] No such file or directory: '%s'" +- % Path('dummy.png').resolve()) + SCALING_OUTPUT = 'style="width: 32.0px; height: 32.0px;" ' + NO_PIL_SYSTEM_MESSAGE = '' + else: diff --git a/sdk_container/src/third_party/portage-stable/dev-python/docutils/files/docutils-0.21.2-pygments-2.19.patch b/sdk_container/src/third_party/portage-stable/dev-python/docutils/files/docutils-0.21.2-pygments-2.19.patch new file mode 100644 index 0000000000..e667226d19 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-python/docutils/files/docutils-0.21.2-pygments-2.19.patch @@ -0,0 +1,106 @@ +From 5854d09635b3fa1048d84bba17de4c38805beccd Mon Sep 17 00:00:00 2001 +From: aa-turner +Date: Fri, 7 Mar 2025 22:49:46 +0000 +Subject: [PATCH] Support Pygments 2.19 in tests + +git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@10019 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 +--- + .../test_rst/test_directives/test_code.py | 16 +++++++++++----- + .../test_rst/test_directives/test_code_long.py | 7 +++---- + test/test_writers/test_html5_polyglot_parts.py | 4 +--- + 3 files changed, 15 insertions(+), 12 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 a54901dfe..a714f8fc5 100755 +--- a/test/test_parsers/test_rst/test_directives/test_code.py ++++ b/test/test_parsers/test_rst/test_directives/test_code.py +@@ -25,10 +25,16 @@ from docutils.utils.code_analyzer import with_pygments + + if with_pygments: + import pygments +- _pv = re.match(r'^([0-9]+)\.([0-9]*)', pygments.__version__) +- PYGMENTS_2_14_PLUS = (int(_pv[1]), int(_pv[2])) >= (2, 14) ++ ++ pygments_version = tuple(map(int, pygments.__version__.split('.')[:2])) ++else: ++ pygments_version = (0, 0) ++ ++PYGMENTS_2_14_PLUS = pygments_version >= (2, 14) ++if pygments_version >= (2, 19): ++ def_ws = '\n ' + else: +- PYGMENTS_2_14_PLUS = None ++ def_ws = ' ' + + + class ParserTestCase(unittest.TestCase): +@@ -160,14 +166,14 @@ totest['code_parsing'] = [ + # and now for something completely different + print(8/2) + """, +-"""\ ++f"""\ + + + + 7 \n\ + + def +- \n\ ++ {def_ws} + + my_function + +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 89cb4b172..037768c01 100755 +--- a/test/test_parsers/test_rst/test_directives/test_code_long.py ++++ b/test/test_parsers/test_rst/test_directives/test_code_long.py +@@ -22,8 +22,7 @@ from docutils.parsers.rst import Parser + from docutils.utils import new_document + from docutils.utils.code_analyzer import with_pygments + from test.test_parsers.test_rst.test_directives.test_code \ +- import PYGMENTS_2_14_PLUS +- ++ import PYGMENTS_2_14_PLUS, def_ws + + @unittest.skipUnless(with_pygments, 'needs Pygments') + class ParserTestCase(unittest.TestCase): +@@ -55,14 +54,14 @@ totest['code_parsing_long'] = [ + # and now for something completely different + print(8/2) + """, +-"""\ ++f"""\ + + + + 7 \n\ + + def +- \n\ ++ {def_ws} + + my_function + +diff --git a/test/test_writers/test_html5_polyglot_parts.py b/test/test_writers/test_html5_polyglot_parts.py +index 7122f8469..afe504d41 100644 +--- a/test/test_writers/test_html5_polyglot_parts.py ++++ b/test/test_writers/test_html5_polyglot_parts.py +@@ -14,7 +14,6 @@ standard values, and any entries with empty values. + + from pathlib import Path + import os +-import re + import sys + import unittest + +@@ -30,8 +29,7 @@ from docutils.utils.code_analyzer import with_pygments + + if with_pygments: + import pygments +- _pv = re.match(r'^([0-9]+)\.([0-9]*)', pygments.__version__) +- if (int(_pv[1]), int(_pv[2])) >= (2, 14): ++ if tuple(map(int, pygments.__version__.split('.')[:2])) >= (2, 14): + # pygments output changed in version 2.14 + with_pygments = False +