Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: conf.py: drop backward support for old Sphinx versions

Since commit 5e25b972a22b ("docs: changes: update Python minimal version"),
the minimal Sphinx version is 3.4.3.

Drop support for older versions from the config file.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20250507121117.317810-1-mchehab+huawei@kernel.org>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
b2671785 18848479

+59 -91
+59 -91
Documentation/conf.py
··· 28 28 """ 29 29 return shutil.which(cmd) is not None 30 30 31 - # Get Sphinx version 32 - major, minor, patch = sphinx.version_info[:3] 33 - 34 - # 35 - # Warn about older versions that we don't want to support for much 36 - # longer. 37 - # 38 - if (major < 2) or (major == 2 and minor < 4): 39 - print('WARNING: support for Sphinx < 2.4 will be removed soon.') 40 - 41 31 # If extensions (or modules to document with autodoc) are in another directory, 42 32 # add these directories to sys.path here. If the directory is relative to the 43 33 # documentation root, use os.path.abspath to make it absolute, like shown here. ··· 47 57 'maintainers_include', 'sphinx.ext.autosectionlabel', 48 58 'kernel_abi', 'kernel_feat', 'translations'] 49 59 50 - if major >= 3: 51 - if (major > 3) or (minor > 0 or patch >= 2): 52 - # Sphinx c function parser is more pedantic with regards to type 53 - # checking. Due to that, having macros at c:function cause problems. 54 - # Those needed to be scaped by using c_id_attributes[] array 55 - c_id_attributes = [ 56 - # GCC Compiler types not parsed by Sphinx: 57 - "__restrict__", 60 + # Since Sphinx version 3, the C function parser is more pedantic with regards 61 + # to type checking. Due to that, having macros at c:function cause problems. 62 + # Those needed to be escaped by using c_id_attributes[] array 63 + c_id_attributes = [ 64 + # GCC Compiler types not parsed by Sphinx: 65 + "__restrict__", 58 66 59 - # include/linux/compiler_types.h: 60 - "__iomem", 61 - "__kernel", 62 - "noinstr", 63 - "notrace", 64 - "__percpu", 65 - "__rcu", 66 - "__user", 67 - "__force", 68 - "__counted_by_le", 69 - "__counted_by_be", 67 + # include/linux/compiler_types.h: 68 + "__iomem", 69 + "__kernel", 70 + "noinstr", 71 + "notrace", 72 + "__percpu", 73 + "__rcu", 74 + "__user", 75 + "__force", 76 + "__counted_by_le", 77 + "__counted_by_be", 70 78 71 - # include/linux/compiler_attributes.h: 72 - "__alias", 73 - "__aligned", 74 - "__aligned_largest", 75 - "__always_inline", 76 - "__assume_aligned", 77 - "__cold", 78 - "__attribute_const__", 79 - "__copy", 80 - "__pure", 81 - "__designated_init", 82 - "__visible", 83 - "__printf", 84 - "__scanf", 85 - "__gnu_inline", 86 - "__malloc", 87 - "__mode", 88 - "__no_caller_saved_registers", 89 - "__noclone", 90 - "__nonstring", 91 - "__noreturn", 92 - "__packed", 93 - "__pure", 94 - "__section", 95 - "__always_unused", 96 - "__maybe_unused", 97 - "__used", 98 - "__weak", 99 - "noinline", 100 - "__fix_address", 101 - "__counted_by", 79 + # include/linux/compiler_attributes.h: 80 + "__alias", 81 + "__aligned", 82 + "__aligned_largest", 83 + "__always_inline", 84 + "__assume_aligned", 85 + "__cold", 86 + "__attribute_const__", 87 + "__copy", 88 + "__pure", 89 + "__designated_init", 90 + "__visible", 91 + "__printf", 92 + "__scanf", 93 + "__gnu_inline", 94 + "__malloc", 95 + "__mode", 96 + "__no_caller_saved_registers", 97 + "__noclone", 98 + "__nonstring", 99 + "__noreturn", 100 + "__packed", 101 + "__pure", 102 + "__section", 103 + "__always_unused", 104 + "__maybe_unused", 105 + "__used", 106 + "__weak", 107 + "noinline", 108 + "__fix_address", 109 + "__counted_by", 102 110 103 - # include/linux/memblock.h: 104 - "__init_memblock", 105 - "__meminit", 111 + # include/linux/memblock.h: 112 + "__init_memblock", 113 + "__meminit", 106 114 107 - # include/linux/init.h: 108 - "__init", 109 - "__ref", 115 + # include/linux/init.h: 116 + "__init", 117 + "__ref", 110 118 111 - # include/linux/linkage.h: 112 - "asmlinkage", 119 + # include/linux/linkage.h: 120 + "asmlinkage", 113 121 114 - # include/linux/btf.h 115 - "__bpf_kfunc", 116 - ] 117 - 118 - else: 119 - extensions.append('cdomain') 122 + # include/linux/btf.h 123 + "__bpf_kfunc", 124 + ] 120 125 121 126 # Ensure that autosectionlabel will produce unique names 122 127 autosectionlabel_prefix_document = True ··· 133 148 load_imgmath = False 134 149 else: 135 150 sys.stderr.write("Unknown env SPHINX_IMGMATH=%s ignored.\n" % env_sphinx_imgmath) 136 - 137 - # Always load imgmath for Sphinx <1.8 or for epub docs 138 - load_imgmath = (load_imgmath or (major == 1 and minor < 8) 139 - or 'epub' in sys.argv) 140 151 141 152 if load_imgmath: 142 153 extensions.append("sphinx.ext.imgmath") ··· 303 322 for l in css: 304 323 html_css_files.append(l) 305 324 306 - if major <= 1 and minor < 8: 307 - html_context = { 308 - 'css_files': [], 309 - } 310 - 311 - for l in html_css_files: 312 - html_context['css_files'].append('_static/' + l) 313 - 314 325 if html_theme == 'alabaster': 315 326 html_theme_options = { 316 327 'description': get_cline_version(), ··· 381 408 \\setmonofont{DejaVu Sans Mono} 382 409 ''', 383 410 } 384 - 385 - # Fix reference escape troubles with Sphinx 1.4.x 386 - if major == 1: 387 - latex_elements['preamble'] += '\\renewcommand*{\\DUrole}[2]{ #2 }\n' 388 - 389 411 390 412 # Load kerneldoc specific LaTeX settings 391 413 latex_elements['preamble'] += '''