From nobody Tue Oct 7 14:47:23 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 F2E432E62D3; Wed, 9 Jul 2025 13:52:21 +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=1752069142; cv=none; b=F03xLaX7zdUYiLJ+KYyZiHVazRVBEKP+5TM5xc/uVkQA9l5uPyJiu4ZnrA/gpH/ZUZgkHWl53yqT7LpzwWPNdo/0uI9XJfFQAQnBIG6N7iDTM6YFXNL9xWKG0w+3XJX+qQ/aDYiDhtoabBmB93rEnMrzpnltpfMASaFbheqL+g8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752069142; c=relaxed/simple; bh=ki5wlJa+Ive/qv1Artc7D8D1XJBHfhfyZzJdUIy50F4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MbGcOGMZN/FMiEDXHgHmp7CoDmL4v3ZHIL8KYzkVbCx4ES1FJ/uBvB4NXvw0jlRigso/pBCnIPqmwd6xsGn3rn1IjK244j02z2tAHoyj1OQ1eRxKqQH7uCK2vjbf+8001H1GvJnlI/kKMSMh0Xr4erPzC+9AiUuqZ3C9+wDUiHw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Jr3TdxNU; 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="Jr3TdxNU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE68BC2BC9E; Wed, 9 Jul 2025 13:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752069141; bh=ki5wlJa+Ive/qv1Artc7D8D1XJBHfhfyZzJdUIy50F4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jr3TdxNUPxwDQ0+KAn7MxHZo6eaufpyFTWDuzre1fsTcUiWOgDf6imsmwM2oPfpFc e8re19FLOG4ULbZEDupkuWS5tsCyg2uHmDDMYKO9PWYYvw8XNIbJ3/T2+7Cnfu5Nyz k4vEDOh5hKTc+Zh48pQFqpnHrFYB+mua1kNSCO2QbXzWJSEk6NYlYUi06JcRPFiuBc RIqIIRhuCqco1O8ycuMMFjOziAX6JjiKYUWe5VN7kpNNB4Q7N/+xy4KD07vmLgDCif Rb8GSEiUMkJp9WcCq3jBT+LYRZg/nGoYZOpMbHaW2RUos18gOulDhuDd0uuJu4J13o RMcYlN4RPdL9A== Received: from mchehab by mail.kernel.org with local (Exim 4.98.2) (envelope-from ) id 1uZVDd-00000000ED7-2Ol3; Wed, 09 Jul 2025 15:52:17 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Akira Yokosawa" , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v2 21/39] scripts: sphinx-pre-install: move package instructions to a new func Date: Wed, 9 Jul 2025 15:51:53 +0200 Message-ID: <243a2d17dcbf262fb5eff8d66cdb78be35bd1aca.1752067814.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.49.0 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" Currently, if Python < 3.7, package install will fail. That happens with OpenSuse Leap and RHEL-based ver 8 distros. OpenSuse allows installing Sphinx with Python 3.11, but RHEL-based distros don't. Prepare to recomend only venv on such cases. For now, just split the recomendation on a new function that will check for a paramtere to be called. Signed-off-by: Mauro Carvalho Chehab --- scripts/sphinx-pre-install.py | 44 +++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/scripts/sphinx-pre-install.py b/scripts/sphinx-pre-install.py index 2f6036eadc94..2360ca2ed21c 100755 --- a/scripts/sphinx-pre-install.py +++ b/scripts/sphinx-pre-install.py @@ -89,6 +89,9 @@ class SphinxDependencyChecker: self.python_cmd =3D "" self.activate_cmd =3D "" =20 + # Some distros may not have a Sphinx shipped package compatible wi= th + # our minimal requirements + self.package_supported =3D True # Certain hints are meant to be shown only once self.first_hint =3D True =20 @@ -969,6 +972,27 @@ class SphinxDependencyChecker: =20 return self.latest_avail_ver =20 + def recommend_package(self): + + print("\n2) As a package with:") + + old_need =3D self.need + old_optional =3D self.optional + self.missing =3D {} + self.pdf =3D False + self.optional =3D 0 + self.install =3D "" + old_verbose =3D self.verbose_warn_install + self.verbose_warn_install =3D 0 + + self.add_package("python-sphinx", 0) + + self.check_distros() + + self.need =3D old_need + self.optional =3D old_optional + self.verbose_warn_install =3D old_verbose + def recommend_sphinx_version(self, virtualenv_cmd): # The logic here is complex, as it have to deal with different ver= sions: # - minimal supported version; @@ -1053,24 +1077,8 @@ class SphinxDependencyChecker: print(f"\tpip install -r {self.requirement_file}") self.deactivate_help() =20 - print("\n2) As a package with:") - - old_need =3D self.need - old_optional =3D self.optional - self.missing =3D {} - self.pdf =3D False - self.optional =3D 0 - self.install =3D "" - old_verbose =3D self.verbose_warn_install - self.verbose_warn_install =3D 0 - - self.add_package("python-sphinx", 0) - - self.check_distros() - - self.need =3D old_need - self.optional =3D old_optional - self.verbose_warn_install =3D old_verbose + if self.package_supported: + self.recommend_package() =20 print("\n" \ " Please note that Sphinx >=3D 3.0 will currently produce= false-positive\n" \ --=20 2.49.0