docs: Raise the minimum Sphinx requirement to 2.4.4
authorJonathan Corbet <corbet@lwn.net>
Fri, 8 Dec 2023 23:10:17 +0000 (16:10 -0700)
committerJonathan Corbet <corbet@lwn.net>
Fri, 15 Dec 2023 15:36:33 +0000 (08:36 -0700)
Commit 31abfdda6527 (docs: Deprecate use of Sphinx < 2.4.x) in 6.2 added a
warning that support for older versions of Sphinx would be going away.
There have been no complaints, so the time has come.  Raise the minimum
Sphinx version to 2.4.4 and clean out some compatibility code that we no
longer need.

Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lore.kernel.org/r/874jgs47fq.fsf@meer.lwn.net
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/conf.py
Documentation/doc-guide/sphinx.rst
Documentation/process/changes.rst
Documentation/sphinx/automarkup.py
Documentation/sphinx/cdomain.py
Documentation/sphinx/kfigure.py
scripts/sphinx-pre-install

index 20bd74edcca9fd8d20207b91775cbd73925eb6c2..3a1a804c3a13d294e9fe59f06cd3ad62986147ad 100644 (file)
@@ -47,7 +47,7 @@ from load_config import loadConfig
 # -- General configuration ------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
-needs_sphinx = '1.7'
+needs_sphinx = '2.4.4'
 
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
index bb7971643fcf70f2a4acab09c80ad73843f5bd1c..3d125fb4139d2455130fc5be6f810a34d1fc3c8f 100644 (file)
@@ -28,7 +28,7 @@ Sphinx Install
 ==============
 
 The ReST markups currently used by the Documentation/ files are meant to be
-built with ``Sphinx`` version 1.7 or higher.
+built with ``Sphinx`` version 2.4.4 or higher.
 
 There's a script that checks for the Sphinx requirements. Please see
 :ref:`sphinx-pre-install` for further details.
index bb96ca0f774b9a714f6769b950ef28ec4b789325..559587a89974407ce096ac00ad8c8bd8b9994cec 100644 (file)
@@ -58,7 +58,7 @@ mcelog                 0.6              mcelog --version
 iptables               1.4.2            iptables -V
 openssl & libcrypto    1.0.0            openssl version
 bc                     1.06.95          bc --version
-Sphinx\ [#f1]_         1.7              sphinx-build --version
+Sphinx\ [#f1]_         2.4.4            sphinx-build --version
 cpio                   any              cpio --version
 GNU tar                1.28             tar --version
 gtags (optional)       6.6.5            gtags --version
index acc6d55718bd88f9d09ec008ef0208faea0b3320..a413f8dd5115871906cb517a391a2818a3460640 100644 (file)
@@ -7,11 +7,7 @@
 from docutils import nodes
 import sphinx
 from sphinx import addnodes
-if sphinx.version_info[0] < 2 or \
-   sphinx.version_info[0] == 2 and sphinx.version_info[1] < 1:
-    from sphinx.environment import NoUri
-else:
-    from sphinx.errors import NoUri
+from sphinx.errors import NoUri
 import re
 from itertools import chain
 
index 4eb150bf509ca87fc59d827899ed380ceb785063..e6959af25402dd6da37e86c8397c5d2ca76e7263 100644 (file)
@@ -127,11 +127,7 @@ def setup(app):
 
     # Handle easy Sphinx 3.1+ simple new tags: :c:expr and .. c:namespace::
     app.connect('source-read', c_markups)
-
-    if (major == 1 and minor < 8):
-        app.override_domain(CDomain)
-    else:
-        app.add_domain(CDomain, override=True)
+    app.add_domain(CDomain, override=True)
 
     return dict(
         version = __version__,
index 13e885bbd499c6ec9189b02d1309303b3fa3a347..97166333b7270347709a89e1d749248f59bddc5b 100644 (file)
@@ -61,13 +61,7 @@ import sphinx
 from sphinx.util.nodes import clean_astext
 import kernellog
 
-# Get Sphinx version
-major, minor, patch = sphinx.version_info[:3]
-if major == 1 and minor > 3:
-    # patches.Figure only landed in Sphinx 1.4
-    from sphinx.directives.patches import Figure  # pylint: disable=C0413
-else:
-    Figure = images.Figure
+Figure = images.Figure
 
 __version__  = '1.0.0'
 
index 1fb88fdceec385d3cd5ca319cf61dc255d5909bc..25aefbb35377f9ffd40b9bd9f00c37ab4c37386e 100755 (executable)
@@ -32,8 +32,7 @@ my $python_cmd = "";
 my $activate_cmd;
 my $min_version;
 my $cur_version;
-my $rec_version = "1.7.9";     # PDF won't build here
-my $min_pdf_version = "2.4.4"; # Min version where pdf builds
+my $rec_version = "3.4.3";
 my $latest_avail_ver;
 
 #
@@ -791,9 +790,6 @@ sub recommend_sphinx_version($)
 
        # Version is OK. Nothing to do.
        if ($cur_version && ($cur_version ge $rec_version)) {
-               if ($cur_version lt $min_pdf_version) {
-                       print "note: If you want pdf, you need at least Sphinx $min_pdf_version.\n";
-               }
                return;
        };
 
@@ -842,10 +838,6 @@ sub recommend_sphinx_version($)
                        printf "\t. $activate_cmd\n";
                        deactivate_help();
 
-                       if ($latest_avail_ver lt $min_pdf_version) {
-                               print "note: If you want pdf, you need at least Sphinx $min_pdf_version.\n";
-                       }
-
                        return;
                }