From nobody Fri Oct 3 07:39:30 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D01B1FA272; Wed, 3 Sep 2025 15:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756914302; cv=none; b=oPIX7dLB6XpS8YVnLnvvgdaJa5nhZVdTFcpNRNC7SEb71d7Ru+ZHUyOlCpghzUIM+lFgL8wW1DLTcRgj+A6GLw5IyXIaqVAsP/6ZLKXSG0V/fkt7aOs7CIdkFesXUqtgwXEvCtQ2jbeQRS05pDddal8wX8RhN8WNJTWDkGF8zOY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756914302; c=relaxed/simple; bh=/dLIDswzK4KrvEpdBfQvdI/IqyHPjqk3TcTvIyNvmfo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=jXwhu6k0/T6MevsnTzbBXC3LxPUawA5YpxvNKZ3k9AqdYW+Mbm3Uy7Yb/e2TVigyFSe9z5i7uJiY7ufdCn5+d8/cVd9b2624wIjcGVoX+13ovsQJ5eY+93DQ5a30cqUlQs8MFuhvHctCwtFzcwl0QZEv0eQ0/jF404NGzWIlgeI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fWNTmoU0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fWNTmoU0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E4DAC4CEE7; Wed, 3 Sep 2025 15:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756914301; bh=/dLIDswzK4KrvEpdBfQvdI/IqyHPjqk3TcTvIyNvmfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWNTmoU0ZOD+ndmT4jIR7jkei4i9P6Ueh3zbbwnwPV6+43eyxRH7+LOM0Xpps1OK4 Zp2pqv7NaIdtB6RRHgziJC5BQI1iXXhuJngkqBwKOddCYwp8AHKDF+qIt5eD6J1OH1 ozyoQ7jsMjHfaBdgNkM/sPV4BPoNhzNFIrm1vNADh/a3lz+6z/K5mAnG85P4W+MUt2 AsZpucUUmspcPGBxe3vsNJJsGxt425GtePEq//cxQvWIzmddRKrb7qA7/bT0Bj+tLe 9Fz51AJJ9rHfebMHqEGSyxGlRxeLO+l/tDvFpl9aBM2oqEo7jfH4MhTQCCkYj4N5VZ 6N39+nCmEYfkw== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1utpfO-00000007N6Q-409i; Wed, 03 Sep 2025 17:44:58 +0200 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH RFC 1/3] tools/docs: python_version.py: drop a debug print Date: Wed, 3 Sep 2025 17:44:34 +0200 Message-ID: <623f783ca31fa33e71d700f1c5c659f7171acb51.1756913837.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab The version print at the lib was added for debugging purposes. Get rid of it. Signed-off-by: Mauro Carvalho Chehab --- tools/docs/lib/python_version.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/docs/lib/python_version.py b/tools/docs/lib/python_versi= on.py index 0519d524e547..660bfe7d23fa 100644 --- a/tools/docs/lib/python_version.py +++ b/tools/docs/lib/python_version.py @@ -109,8 +109,6 @@ class PythonVersion: cur_ver =3D sys.version_info[:3] if cur_ver >=3D min_version: ver =3D PythonVersion.ver_str(cur_ver) - print(f"Python version: {ver}") - return =20 python_ver =3D PythonVersion.ver_str(cur_ver) --=20 2.51.0 From nobody Fri Oct 3 07:39:30 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D2E0285057; Wed, 3 Sep 2025 15:45:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756914301; cv=none; b=oKraLeLO6qY7Gpk4PaWxNlhj1zdVsZJLXz6tLDJiHbvCVWd59PHVBac5kHkDfDgCZk4Q2UOcJ31JLfuY554T8gBWKocqOsMkp3ZOWeSWapSY5V7adYUDCo3FFfGNIx121o8udk4UY91RQ5xMDxiAtr6/vypxBMS4/KFH2PisEuI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756914301; c=relaxed/simple; bh=FBWucXdyWLLs836/YCptcNQxfVLAAZk1Il0uQKnptzs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=g5zCV7mUry4bIWEJVQrT3/KdAzIkOvEHmOBFLFhYylyiyJBtkWuBieX9GpPJ0OMm7pDXUlFQ9PO+g6L38rd5Vagq88+snXkGgcXZ0wRjCwtocIn0xT3/HYu1veYCV+pSmsGZvuQVcjWy0/E6dRZW8Q4poqGaF9BPwBJ9jDqdaD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PKMi0DJq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PKMi0DJq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D8AFC4CEF7; Wed, 3 Sep 2025 15:45:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756914301; bh=FBWucXdyWLLs836/YCptcNQxfVLAAZk1Il0uQKnptzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PKMi0DJqQI+p7ljivn/WK9A+PQYpv+F007yL8E9Sp2AKCRb/kTwQDBcmYSrz8Dqma QXjzqDbbVOrHKKDFdAMGvw3ijum71EYXk27vpvbUQRIslVbfkrobVm6Suv4yXDO0RP t4AqTTyAPehpNbeH1dEJaTSNyUvLB84QhpuP27snJlMGKxYNuxk8pkvgmcx/WD8w5P I5xGqaaucIFZ9SI99PRAg04M6B7vEyaUrSlWrk9ALvpIrf/6Em0+lmueWkb37so8gB nYH7kEeiknMS5j1eV6DFXwjKnmpK7pcDi6wtN60DacuzctCROFc0ykAoVh4tSreWMD iTj71C6CdjsCA== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1utpfP-00000007N6X-2Rz4; Wed, 03 Sep 2025 17:44:59 +0200 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH RFC 2/3] tools/docs: python_version: allow check for alternatives and bail out Date: Wed, 3 Sep 2025 17:44:35 +0200 Message-ID: X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab The caller script may not want an automatic execution of the new version. Add two parameters to allow showing alternatives and to bail out if version is incompatible. Signed-off-by: Mauro Carvalho Chehab --- tools/docs/lib/python_version.py | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/tools/docs/lib/python_version.py b/tools/docs/lib/python_versi= on.py index 660bfe7d23fa..e2e9f9a3d421 100644 --- a/tools/docs/lib/python_version.py +++ b/tools/docs/lib/python_version.py @@ -85,10 +85,12 @@ class PythonVersion: may need to update it one day, hopefully on a distant future. """ patterns =3D [ - "python3.[0-9]", "python3.[0-9][0-9]", + "python3.[0-9]", ] =20 + python_cmd =3D [] + # Seek for a python binary newer than min_version for path in os.getenv("PATH", "").split(":"): for pattern in patterns: @@ -96,12 +98,12 @@ class PythonVersion: if os.path.isfile(cmd) and os.access(cmd, os.X_OK): version =3D PythonVersion.get_python_version(cmd) if version >=3D min_version: - return cmd + python_cmd.append((version, cmd)) =20 - return None + return sorted(python_cmd, reverse=3DTrue) =20 @staticmethod - def check_python(min_version): + def check_python(min_version, show_alternatives=3DFalse, bail_out=3DFa= lse): """ Check if the current python binary satisfies our minimal requireme= nt for Sphinx build. If not, re-run with a newer version if found. @@ -113,18 +115,33 @@ class PythonVersion: =20 python_ver =3D PythonVersion.ver_str(cur_ver) =20 - new_python_cmd =3D PythonVersion.find_python(min_version) - if not new_python_cmd: + available_versions =3D PythonVersion.find_python(min_version) + if not available_versions: print(f"ERROR: Python version {python_ver} is not spported any= more\n") print(" Can't find a new version. This script may fail") return =20 - # Restart script using the newer version + # Check possible alternatives + if available_versions: + new_python_cmd =3D available_versions[0][1] + else: + new_python_cmd =3D None + script_path =3D os.path.abspath(sys.argv[0]) args =3D [new_python_cmd, script_path] + sys.argv[1:] =20 + if show_alternatives: + print("Available Python versions:") + for _, cmd in available_versions: + print(f" {cmd}") + print() + + if bail_out: + sys.exit(f"Python {python_ver} not supported. Bailing out") + print(f"Python {python_ver} not supported. Changing to {new_python= _cmd}") =20 + # Restart script using the newer version try: os.execv(new_python_cmd, args) except OSError as e: --=20 2.51.0 From nobody Fri Oct 3 07:39:30 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACBF6285C8A; Wed, 3 Sep 2025 15:45:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756914302; cv=none; b=pwRSRdHvmoasqg3MWG47wet9L80CsBgYL8MfaAJ6zbZHi4S/1xe8iMTZ5nDacn+Y2eC5Uf0uRx5hmwWVlFbcXjRcjilc1Y0MJdNkucC0kEW1MgJqineQCejwisW12RCp4VKa+Yd5pCvvce2lIsxhtIwARU1GzSwa/tV+aD0t+kk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756914302; c=relaxed/simple; bh=uGAsJGJpxFTuaDQGGkCgIKWHmb8lqqQagqgiF5HxTWc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Me/UsGWH9GygJ7j/T+jJ/UdinzGx8Ke7GMg6zsBFrucyrpRheFPX3Tme27mNgXlIrSUPKDxsou9Feb9PxdihMRYn7u3BRVJq8KlhKr9UW8YeelIFWXq1xwy/RgM0zPvQH5me+d9ptsKf0j6i84Vu9CIlCLwLf7WLhJDHhuxg5oA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RpZOoyQJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RpZOoyQJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A8E0C4CEF0; Wed, 3 Sep 2025 15:45:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756914302; bh=uGAsJGJpxFTuaDQGGkCgIKWHmb8lqqQagqgiF5HxTWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RpZOoyQJjY6zwmfqMRfRaJs1CEyKHhqCZmi2VogdhVE64l8kCkKVq8YYkKF3RJQB5 /JaNo6aZSbVKNgCbOXfuSsphLmfOldD3xDVs2dT+ShQe+eUKhU9LTHpMoJwuJmgu88 Yky28Ohx5PrYUQEqS3PkJbIzGdms8+hCb/Q44vkrSIqYjFkvagxl6g/CsGBJzi3p5y gKKUhY/mFJMou+v1o0tT+sIQi54DAlPs5FiPAROWWuCPNSVnXbJis5ymwrJ+QUYyhG VLHJfK6FfiPXgYBuTjDYk/5xLy8iL9VtEu4riCoNpC7rAnxKjXzRE6bV9oemrM9s9k qumLtKUWxtHMA== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1utpfQ-00000007N6f-0ucW; Wed, 03 Sep 2025 17:45:00 +0200 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH RFC 3/3] tools/docs: sphinx-* break documentation bulds on openSUSE Date: Wed, 3 Sep 2025 17:44:36 +0200 Message-ID: <35ccc7da482127f1ed1f04b22b6fe42c39e86ab7.1756913837.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Before this patch, building htmldocs on opensuseLEAP works fine: # make htmldocs Available Python versions: /usr/bin/python3.11 Python 3.6.15 not supported. Changing to /usr/bin/python3.11 Python 3.6.15 not supported. Changing to /usr/bin/python3.11 Using alabaster theme Using Python kernel-doc ... As the logic detects that Python 3.6 is too old and recommends intalling python311-Sphinx. If installed, documentation builds work like a charm. Yet, some develpers complained that running python3.11 instead of python3 should not happen. So, let's break the build to make them happier: # make htmldocs Available Python versions: /usr/bin/python3.11 Python 3.6.15 not supported. Bailing out make[2]: *** [Documentation/Makefile:74: htmldocs] Error 1 make[1]: *** [/root/Makefile:1806: htmldocs] Error 2 make: *** [Makefile:248: __sub-make] Error 2 It should be then up to the user to figure out a way to make it work again. Signed-off-by: Mauro Carvalho Chehab --- tools/docs/sphinx-pre-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docs/sphinx-pre-install b/tools/docs/sphinx-pre-install index 663d4e2a3f57..ecd08e09bae9 100755 --- a/tools/docs/sphinx-pre-install +++ b/tools/docs/sphinx-pre-install @@ -1531,7 +1531,7 @@ def main(): =20 checker =3D SphinxDependencyChecker(args) =20 - PythonVersion.check_python(MIN_PYTHON_VERSION) + PythonVersion.check_python(MIN_PYTHON_VERSION, show_alternatives=3DTru= e) checker.check_needs() =20 # Call main if not used as module --=20 2.51.0