From 4bca3b25891c74750408e1ace2c9e521b9db17d164629b824cc8194f9bb6eee5 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 26 Jun 2024 20:10:05 +0000 Subject: [PATCH] - Add docs-docutils_014-Sphinx_420.patch make building docs compatible with Sphinx 4_2_0 and docutils 0.14. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python312?expand=0&rev=50 --- docs-docutils_014-Sphinx_420.patch | 78 ++++++++++++++++++++++++++++++ python312.changes | 6 +++ python312.spec | 6 +++ 3 files changed, 90 insertions(+) create mode 100644 docs-docutils_014-Sphinx_420.patch diff --git a/docs-docutils_014-Sphinx_420.patch b/docs-docutils_014-Sphinx_420.patch new file mode 100644 index 0000000..26563f5 --- /dev/null +++ b/docs-docutils_014-Sphinx_420.patch @@ -0,0 +1,78 @@ +--- + Doc/tools/extensions/c_annotations.py | 6 +++++- + Doc/tools/extensions/glossary_search.py | 12 ++++++++++-- + Doc/tools/extensions/pyspecific.py | 13 ++++++++++--- + 3 files changed, 25 insertions(+), 6 deletions(-) + +--- a/Doc/tools/extensions/c_annotations.py ++++ b/Doc/tools/extensions/c_annotations.py +@@ -84,7 +84,11 @@ class Annotations: + self.stable_abi_data[name] = record + + def add_annotations(self, app, doctree): +- for node in doctree.findall(addnodes.desc_content): ++ try: ++ findall = doctree.findall ++ except AttributeError: ++ findall = doctree.traverse ++ for node in findall(addnodes.desc_content): + par = node.parent + if par['domain'] != 'c': + continue +--- a/Doc/tools/extensions/glossary_search.py ++++ b/Doc/tools/extensions/glossary_search.py +@@ -25,8 +25,16 @@ def process_glossary_nodes(app, doctree, + + terms = {} + +- for node in doctree.findall(glossary): +- for glossary_item in node.findall(definition_list_item): ++ try: ++ findall = doctree.findall ++ except AttributeError: ++ findall = doctree.traverse ++ for node in findall(glossary): ++ try: ++ node_findall = node.findall ++ except AttributeError: ++ node_findall = node.traverse ++ for glossary_item in node_findall(definition_list_item): + term = glossary_item[0].astext().lower() + definition = glossary_item[1] + +--- a/Doc/tools/extensions/pyspecific.py ++++ b/Doc/tools/extensions/pyspecific.py +@@ -27,7 +27,10 @@ from sphinx.locale import _ as sphinx_ge + from sphinx.util import logging + from sphinx.util.docutils import SphinxDirective + from sphinx.writers.text import TextWriter, TextTranslator +-from sphinx.util.display import status_iterator ++try: ++ from sphinx.util.display import status_iterator ++except ModuleNotFoundError: ++ from sphinx.util import status_iterator + + + ISSUE_URI = 'https://bugs.python.org/issue?@action=redirect&bpo=%s' +@@ -604,7 +607,11 @@ def parse_monitoring_event(env, sig, sig + + + def process_audit_events(app, doctree, fromdocname): +- for node in doctree.findall(audit_event_list): ++ try: ++ findall = doctree.findall ++ except AttributeError: ++ findall = doctree.traverse ++ for node in findall(audit_event_list): + break + else: + return +@@ -663,7 +670,7 @@ def process_audit_events(app, doctree, f + + body += row + +- for node in doctree.findall(audit_event_list): ++ for node in findall(audit_event_list): + node.replace_self(table) + + diff --git a/python312.changes b/python312.changes index 04408c0..756b362 100644 --- a/python312.changes +++ b/python312.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Jun 26 20:00:38 UTC 2024 - Matej Cepl + +- Add docs-docutils_014-Sphinx_420.patch make building docs + compatible with Sphinx 4_2_0 and docutils 0.14. + ------------------------------------------------------------------- Mon Jun 24 12:14:52 UTC 2024 - Andreas Schwab diff --git a/python312.spec b/python312.spec index 0ef7d9b..5e2eafc 100644 --- a/python312.spec +++ b/python312.spec @@ -171,6 +171,9 @@ Patch39: CVE-2023-52425-libexpat-2.6.0-backport-15.6.patch # PATCH-FIX-OPENSUSE fix-test-recursion-limit-15.6.patch gh#python/cpython#115083 # Skip some failing tests in test_compile for i586 arch in 15.6. Patch40: fix-test-recursion-limit-15.6.patch +# PATCH-FIX-SLE docs-docutils_014-Sphinx_420.patch bsc#[0-9]+ mcepl@suse.com +# related to gh#python/cpython#119317 +Patch41: docs-docutils_014-Sphinx_420.patch BuildRequires: autoconf-archive BuildRequires: automake BuildRequires: fdupes @@ -428,6 +431,9 @@ other applications. %setup -q -n %{tarname} %autopatch -p1 +# Fix devhelp doc build gh#python/cpython#120150 +echo "master_doc = 'contents'" >> Doc/conf.py + # drop Autoconf version requirement sed -i 's/^AC_PREREQ/dnl AC_PREREQ/' configure.ac