From nobody Sat Oct 4 22:18:29 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 1A78C2F659E; Tue, 12 Aug 2025 15:53:04 +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=1755013985; cv=none; b=C3eQLQ4T2hFmKNEeg4CdZrxVaMlDmZ2HGWhV4u7teHFKohKNSdBvVXXUUG7dy862kZ1GJf16VtJT7n3iROi/hyUc6gJd/+jPKXpARX2KwqMjlBCmtcA4vTHq+3J0OiLqa7VERok0xRfpaXQpGs8c6sK8kU+vM31RlXUIfSEnX/s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755013985; c=relaxed/simple; bh=tUovukr9LJAZFuTCxPr3I6APWlpK5/pEVeW1gSeYrBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hJSMgRDYyxOqI3vmP/7UjlTAuf4IgCN5L9f8UNbfkznZvni2NeNXGLKCY8UFjZCDGuUUTfmIvjKfNKgNeEXS7cKSBmI4fa0CqgQ2JB0AdEDVgoHu2C6BsbochldqzM9RMHGfi/yrRjR3iWxSEnCpjtn9wcVpaKgecoCKEwIZl0w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=I/+T373I; 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="I/+T373I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA9BEC4CEF7; Tue, 12 Aug 2025 15:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755013984; bh=tUovukr9LJAZFuTCxPr3I6APWlpK5/pEVeW1gSeYrBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I/+T373IkRxMN4+DbM1srsAKLqJA4EpftaFElQ21Z13GAB1+HutvQICiDJDocfqMF EfS5atY9zpDFPSH6RbYx16uq8cvZsw6BRgQvZJ0kKMA/OCxk5Z2EidulJxmuoIR4u0 aZyLXWeJciCwPkGwTMR2cwtONhoHP7ilJqQ3HQYTjZm3nMBCazgMOX0FZ+nq+6jzNP VwlgcrKRCgs3ju7XbFRVDxA6k++hjNb7Zz8kRk4kGs3P3Rb5ybovsDnu9d0KUkSCrC raV4o0DqUFQ8oy1Idt8IMiO1gr3/WDy30rgT32TgsheX2h+0HfMXy4V8nPTvCgvMXv coIGXToQ8uRnw== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1ulrJ8-00000006kWg-35r3; Tue, 12 Aug 2025 17:53:02 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "Jonathan Corbet" , "Mauro Carvalho Chehab" , linux-kernel@vger.kernel.org Subject: [PATCH v2 23/39] scripts: sphinx-pre-install: better handle Python min version Date: Tue, 12 Aug 2025 17:52:40 +0200 Message-ID: <013aeb848ecc3f6b69b4518cf3d335bd2353b6e1.1754992972.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: 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 Content-Type: text/plain; charset="utf-8" Don't do any recommendations about Sphinx install with too old python versions. Signed-off-by: Mauro Carvalho Chehab --- scripts/sphinx-pre-install.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/sphinx-pre-install.py b/scripts/sphinx-pre-install.py index 365590f81551..a5c777e529ec 100755 --- a/scripts/sphinx-pre-install.py +++ b/scripts/sphinx-pre-install.py @@ -92,6 +92,10 @@ class SphinxDependencyChecker: # Some distros may not have a Sphinx shipped package compatible wi= th # our minimal requirements self.package_supported =3D True + + # Recommend a new python version + self.recommend_python =3D None + # Certain hints are meant to be shown only once self.first_hint =3D True =20 @@ -511,11 +515,11 @@ class SphinxDependencyChecker: print("ERROR: Distro not supported. Too old?") return =20 - # TODO: check if RHEL8 still works. - # On my tests with docker "redhat/ubi8" image, there's no - # python3-sphinx (or similar) package. It comes with Python 3.= 6, - # but there are other python packages over there, so it may be - # possible to work with venv. + # RHEL 8 uses Python 3.6, which is not compatible with + # the build system anymore. Suggest Python 3.11 + if rel =3D=3D 8: + self.add_package("python39", 0) + self.recommend_python =3D True =20 if self.first_hint: print("Note: RHEL-based distros typically require extra re= positories.\n" \ @@ -596,6 +600,7 @@ class SphinxDependencyChecker: # the build system anymore. Suggest Python 3.11 if rel =3D=3D 15: if not self.which(self.python_cmd): + self.recommend_python =3D True self.add_package(self.python_cmd, 0) =20 progs.update({ @@ -1000,6 +1005,11 @@ class SphinxDependencyChecker: # - recommended version. # It also needs to work fine with both distro's package and venv/v= irtualenv =20 + if self.recommend_python: + print("\nPython version is incompatible with doc build.\n" \ + "Please upgrade it and re-run.\n") + return + # Version is OK. Nothing to do. if self.cur_version !=3D (0, 0, 0) and self.cur_version >=3D RECOM= MENDED_VERSION: return --=20 2.50.1