From db11dd41ececf6ce4be1b636de2bdd03ff5a4c09 Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Mar 19 2019 11:44:35 +0000 Subject: Stop using Python 2 Sphinx, use Python 3 to build the docs Still uses linkchecker and that runs on Python 2 unfortunately --- diff --git a/869652b426bb34a30ce7b39f0a0ac242ed5b1016.patch b/869652b426bb34a30ce7b39f0a0ac242ed5b1016.patch new file mode 100644 index 0000000..6a8a492 --- /dev/null +++ b/869652b426bb34a30ce7b39f0a0ac242ed5b1016.patch @@ -0,0 +1,58 @@ +From 869652b426bb34a30ce7b39f0a0ac242ed5b1016 Mon Sep 17 00:00:00 2001 +From: Julien Palard +Date: Mon, 18 Mar 2019 19:11:30 +0100 +Subject: [PATCH] [2.7] bpo-35605: Fix documentation build for sphinx<1.6 + (GH-12413) + +(cherry picked from commit dfc8fc15fa989acba3c372572e52bbcb5ab38a37) +--- + Doc/conf.py | 2 +- + Doc/tools/extensions/pyspecific.py | 6 +++++- + .../Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst | 1 + + 3 files changed, 7 insertions(+), 2 deletions(-) + create mode 100644 Misc/NEWS.d/next/Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst + +diff --git a/Doc/conf.py b/Doc/conf.py +index 557fe1e72f27..df76b943b794 100644 +--- a/Doc/conf.py ++++ b/Doc/conf.py +@@ -57,7 +57,7 @@ + + # Custom sidebar templates, filenames relative to this file. + html_sidebars = { +- 'index': 'indexsidebar.html', ++ 'index': ['indexsidebar.html'], + } + + # Additional templates that should be rendered to pages. +diff --git a/Doc/tools/extensions/pyspecific.py b/Doc/tools/extensions/pyspecific.py +index 6378f76bdc2c..1ec88c23e01b 100644 +--- a/Doc/tools/extensions/pyspecific.py ++++ b/Doc/tools/extensions/pyspecific.py +@@ -15,7 +15,6 @@ + from docutils import nodes, utils + from docutils.parsers.rst import Directive + +-from sphinx.util import status_iterator + from sphinx.util.nodes import split_explicit_title + from sphinx.writers.html import HTMLTranslator + from sphinx.writers.latex import LaTeXTranslator +@@ -173,6 +172,11 @@ def get_target_uri(self, docname, typ=None): + return '' # no URIs + + def write(self, *ignored): ++ try: # sphinx>=1.6 ++ from sphinx.util import status_iterator ++ except ImportError: # sphinx<1.6 ++ status_iterator = self.status_iterator ++ + writer = TextWriter(self) + for label in status_iterator(pydoc_topic_labels, + 'building topics... ', +diff --git a/Misc/NEWS.d/next/Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst b/Misc/NEWS.d/next/Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst +new file mode 100644 +index 000000000000..cbc0f1e07f31 +--- /dev/null ++++ b/Misc/NEWS.d/next/Documentation/2018-12-30-09-56-13.bpo-35605.gAWt32.rst +@@ -0,0 +1 @@ ++Fix documentation build for sphinx<1.6. Patch by Anthony Sottile. diff --git a/python2-docs.spec b/python2-docs.spec index 33ee00f..876d4ef 100644 --- a/python2-docs.spec +++ b/python2-docs.spec @@ -9,6 +9,10 @@ License: Python URL: https://www.python.org/ Source: https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz + +# Make it build with Sphinx 2 +Patch1: https://github.com/python/cpython/commit/869652b426bb34a30ce7b39f0a0ac242ed5b1016.patch + # this changes the makefile so that build requires are used instead of # hard coded svn checkout to get sphinx Patch19: python-2.7-texinfomakefile.patch @@ -17,10 +21,10 @@ Patch20: python-2.7-texinfobuilder.patch BuildArch: noarch -BuildRequires: python2 -BuildRequires: python2-docutils -BuildRequires: python2-pygments -BuildRequires: python2-sphinx +BuildRequires: python3 +BuildRequires: python3-docutils +BuildRequires: python3-pygments +BuildRequires: python3-sphinx BuildRequires: linkchecker Recommends: python2 = %{version} @@ -48,10 +52,7 @@ Install the python2-docs-info package if you'd like to read the documentation for the Python 2 language using the info command or Emacs. %prep -%setup -q -n Python-%{version} - -%patch19 -p1 -b .texinfomakefile -%patch20 -p1 -b .texinfobuilder +%autosetup -p1 -n Python-%{version} %build make -C Doc html