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.

scripts: test_doc_build.py: better adjust to python version

Very old versions of Sphinx require older versions of python.
The original script assumes that a python3.9 exec exists,
but this may not be the case.

Relax python requirements.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/32cb41c543293bbbab5fcb15f8a0aefac040e3a9.1750571906.git.mchehab+huawei@kernel.org

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
3fa60d28 fb1e8d12

+18 -5
+18 -5
scripts/test_doc_build.py
··· 12 12 import argparse 13 13 import asyncio 14 14 import os.path 15 + import shutil 15 16 import sys 16 17 import time 17 18 import subprocess 18 19 19 - # Minimal python version supported by the building system 20 - MINIMAL_PYTHON_VERSION = "python3.9" 20 + # Minimal python version supported by the building system. 21 21 22 - # Starting from 8.0.2, Python 3.9 becomes too old 23 - PYTHON_VER_CHANGES = {(8, 0, 2): "python3"} 22 + PYTHON = os.path.basename(sys.executable) 23 + 24 + min_python_bin = None 25 + 26 + for i in range(9, 13): 27 + p = f"python3.{i}" 28 + if shutil.which(p): 29 + min_python_bin = p 30 + break 31 + 32 + if not min_python_bin: 33 + min_python_bin = PYTHON 34 + 35 + # Starting from 8.0, Python 3.9 is not supported anymore. 36 + PYTHON_VER_CHANGES = {(8, 0, 2): PYTHON} 24 37 25 38 # Sphinx versions to be installed and their incremental requirements 26 39 SPHINX_REQUIREMENTS = { ··· 303 290 args.verbose = True 304 291 305 292 cur_requirements = {} 306 - python_bin = MINIMAL_PYTHON_VERSION 293 + python_bin = min_python_bin 307 294 308 295 for cur_ver, new_reqs in SPHINX_REQUIREMENTS.items(): 309 296 cur_requirements.update(new_reqs)