Re: [PATCH 04/11] scripts: sphinx-build-wrapper: add a wrapper for sphinx-build

From: Jonathan Corbet
Date: Thu Aug 21 2025 - 15:38:43 EST


Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx> writes:

> There are too much magic inside docs Makefile to properly run
> sphinx-build. Create an ancillary script that contains all
> kernel-related sphinx-build call logic currently at Makefile.

So I am just now looking at the script and seeking to understand it, but
one thing has jumped at me that I wanted to toss out there...

> +# Minimal supported Python version needed by Sphinx and its extensions
> +MIN_PYTHON_VERSION = parse_version("3.7")
> +
> +# Default value for --venv parameter
> +VENV_DEFAULT = "sphinx_latest"
> +
> +# List of make targets and its corresponding builder and output directory
> +TARGETS = {

We don't at this point have a formal coding standard for Python code,
but I do think that we should, to the extent possible, stick to the
rules that have been established for C code. One thing I would really
like to see is in the comment style; our rules want:

/*
* ...C comments spread out with the markers on separate lines
* like this...
*/

so can we do something similar for Python?

#
# Markers above and below
#

I will confess that this matches my personal subject preference, but it
also brings us closer to what our C code looks like.

(I don't know that I would push to redo everything to match that style,
but instead to move that way going forward).

Thanks,

jon