forked from pool/python314
"SPHINXERRORHANDLING = --fail-on-warning" from Doc/Makefile using the gh139257-Support-docutils-0.22.patch. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python314?expand=0&rev=105
54 lines
2.0 KiB
Diff
54 lines
2.0 KiB
Diff
From 19b61747df3d62c822285c488753d6fbdf91e3ac Mon Sep 17 00:00:00 2001
|
|
From: Daniel Garcia Moreno <daniel.garcia@suse.com>
|
|
Date: Tue, 23 Sep 2025 10:20:16 +0200
|
|
Subject: [PATCH 1/2] gh-139257: Support docutils >= 0.22
|
|
|
|
---
|
|
Doc/tools/extensions/pyspecific.py | 12 +++++++++++-
|
|
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
Index: Python-3.14.0/Doc/tools/extensions/pyspecific.py
|
|
===================================================================
|
|
--- Python-3.14.0.orig/Doc/tools/extensions/pyspecific.py
|
|
+++ Python-3.14.0/Doc/tools/extensions/pyspecific.py
|
|
@@ -25,11 +25,21 @@ from sphinx.util.docutils import SphinxD
|
|
SOURCE_URI = 'https://github.com/python/cpython/tree/3.14/%s'
|
|
|
|
# monkey-patch reST parser to disable alphabetic and roman enumerated lists
|
|
+def _disable_alphabetic_and_roman(text):
|
|
+ try:
|
|
+ # docutils >= 0.22
|
|
+ from docutils.parsers.rst.states import InvalidRomanNumeralError
|
|
+ raise InvalidRomanNumeralError(text)
|
|
+ except ImportError:
|
|
+ # docutils < 0.22
|
|
+ return None
|
|
+
|
|
+
|
|
from docutils.parsers.rst.states import Body
|
|
Body.enum.converters['loweralpha'] = \
|
|
Body.enum.converters['upperalpha'] = \
|
|
Body.enum.converters['lowerroman'] = \
|
|
- Body.enum.converters['upperroman'] = lambda x: None
|
|
+ Body.enum.converters['upperroman'] = _disable_alphabetic_and_roman
|
|
|
|
|
|
class PyAwaitableMixin(object):
|
|
Index: Python-3.14.0/Doc/Makefile
|
|
===================================================================
|
|
--- Python-3.14.0.orig/Doc/Makefile
|
|
+++ Python-3.14.0/Doc/Makefile
|
|
@@ -14,7 +14,11 @@ PAPER =
|
|
SOURCES =
|
|
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
|
|
REQUIREMENTS = requirements.txt
|
|
-SPHINXERRORHANDLING = --fail-on-warning
|
|
+# docutils 0.22 produces the following warning for all the faq pages:
|
|
+# ERROR: The "contents" directive may not be used within topics or
|
|
+# body elements. [docutils]
|
|
+# SPHINXERRORHANDLING = --fail-on-warning
|
|
+SPHINXERRORHANDLING =
|
|
|
|
# Internal variables.
|
|
PAPEROPT_a4 = --define latex_elements.papersize=a4paper
|