Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp320239lqg; Fri, 1 Mar 2024 06:18:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUBHLJq7+PdVdrMQtdcYrqgdCEZZoUM38zJZzaBbmO5oTi7r+e2kvSYTyBQIC920JENe9zipmfiUO3f4mLuZn9RLJqc8nXjxXicbRIWQg== X-Google-Smtp-Source: AGHT+IGPIm66ydVSQArmGx63KJ5Ic9o+iL6gm1LOSHtqJRYtNVSqIIuwEfzYSN9X4UYxfbV7pRPO X-Received: by 2002:a17:906:29d1:b0:a43:5c4f:711d with SMTP id y17-20020a17090629d100b00a435c4f711dmr1254722eje.38.1709302696800; Fri, 01 Mar 2024 06:18:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709302696; cv=pass; d=google.com; s=arc-20160816; b=Dqn1GlZzan8gG9OoNijXxmFFqv8HEdiTAItnCOURiP16P0TYJJoJz0dWVWHXoeaGBP ScJS8diivXKIopob8M+kn8GgAXzAjFUpNnYuLQCNtJoKqmKXOo8Jhko4tAaX7k2IHPiC XF2Tu7fkZK6hVyv7KcMWM69KX0FsoXqaozDnVdSfY1iEUcJbeoJCwUUlqEEWKDqzPKjc WrMUxxheQej1OAkk045rov3ZNW0fx9U9pgQzxw0s/k9OmEV2CRJCB2uTnft/CCZAUiZw 2CYxdekESJsB1WOCCYJj8xuiPmUZBL93XNghaqqE4MciIyZLQ9qKNQlS395vVI1Yjp6H X28g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=iZ5qWcryj1xGwlryYdwJv9e3FPpE5SnnsgIwWyR+VCI=; fh=BHi2aKv8YszeXc9rFF+GeOHYTWbEjE6gPpSPeKSkYfU=; b=eKFqZHiIl0xbLXLzrJFybb+V28Zs2xA3Yg7SA6Zud2KKUXpjpBhQt+Zk1WmNOWshpf tIPJrKeKf2OWT48pSi2Sok+zFg1OWqxHW+1zwiFmVXtwW0FU3WTLNkBwsyH9PydcCpmh 3IpPzzDtDWFG2H92YFJl3N9Grw04Y9vodpGCTwAKgy40k5j8iNowXH7r1xF9iFTjZWGL dgQf8YjpYAOJvJOyLA9jNKTXwPwH4e19cGq3VZ0uOxOMrEFVDXcATe1YSwQcX4fmPLCU 1sROPiOjXxVnLGnhZ3It+g4IUnIoIl0xFAGOCpyYWLCUaNMjBgicjj5by4sBOxN4Juho kDWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gk5b3wei; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-88542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kx12-20020a170907774c00b00a435dbc4c06si1464359ejc.494.2024.03.01.06.18.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 06:18:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gk5b3wei; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-88542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4D9881F21F3D for ; Fri, 1 Mar 2024 14:18:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CA7C6F076; Fri, 1 Mar 2024 14:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gk5b3wei" Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C365E6EB7D; Fri, 1 Mar 2024 14:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709302686; cv=none; b=HxYEXogrDsLn4gO/dEyF9Ctykq7Ztcm4Jt5M6IgHlDMBDT+zuoEHjf33ct7InrJGxnHoXDJL/3lFcFPZXTE6sMjm3MMvf1wrRvxmFT/reahYX+7pXg6+RygRiQqywuwtUM7kHjq9HDsmkPdDiXGdXaJv2M4pUbVBhtEv+C4RAXk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709302686; c=relaxed/simple; bh=D+vLVgNSB6OJCkwkdiQ/Iewxjkio5RJ2m9abpN1+EHI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=f+6vtFrcpghs/hONxStmzeqGiGmA4TjKebBG+utcXXTxd4p3GQrkDeb8EzqfgEKe+wH0hsqCnpiGwtOWWIh6/zpHPtIuCOkqmtIurYlH0eSw3cSeEXT8a7yOqkXldD4+fT9Ujv/5jCOI8E6xd/DTo6ZvM8t4d2452KvGgMuO5sc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gk5b3wei; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-33d18931a94so1219218f8f.1; Fri, 01 Mar 2024 06:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709302683; x=1709907483; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=iZ5qWcryj1xGwlryYdwJv9e3FPpE5SnnsgIwWyR+VCI=; b=gk5b3weiC+NAv21ctRURRrS6et69aHeYQXSr73e322QlK11dggZNUkxIvRN9hqjg9t vGstpaFDgJQEdzaQCgFXJhMUjsTh0609If6u/wFOsjXMP6XqesOvzPwQ5a5rt0qFLsez lCOhhPtGHpAg+Y1xrVhBD+ArqTVIsgILfyhjP5Z5lRTHDbz7+LPrTM4yqO+ipJSMCyDj 2l6oRxLO0uxeRxgrfNdoSqb989h4gRhrH7nDG8z6Ji2EnbG/agkWNqKyqIbTckoqOqaj Ehag6KgrTkB0pik4SiqcH9EMg4GEja4vIve4Yb5YbBsQPRESMiwTinicLe3wyoZjN1s8 Wd9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709302683; x=1709907483; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iZ5qWcryj1xGwlryYdwJv9e3FPpE5SnnsgIwWyR+VCI=; b=sgUJm19mWM3iHAYfiSJBX4sDFKSPboCKFRn2wFRk4MfwLDaW/2pEFUAS7DOYKQ8COp QpUZhmlTZZRWvEHUZV3Z0HqwyvvECkwTsXo2tW9MPolZpg8pOqAM5LhMryHEiP8IL0yY PxBAkLG3rynTXrFbu+F7txV5MH/O6RoU7m8q83/sBc+PSmq9h5P25gGb+Yxd5OHv7u5K eL0Gshnk7WYX0HKhwVhxlRXm3vp0aUZAuPGdzUY2JgZJL5kQL9OOXFlSpcGn7LO+jOaI Qmd8uPqBHdhIiYVD5p/PnyK2exdX7yNAlKWWrjyEy95AkKXBRSnJH0mohGWtge0O65Fh chhw== X-Forwarded-Encrypted: i=1; AJvYcCUi9t81njMyl8AWMx3kQytzEB0RIqXn9Fq5pIQ4IRc8WHvlLDAjID8fLeC5CHfIxIFxJdE4lrVnniSWWu2geAqrpbtIhLGOEYcr X-Gm-Message-State: AOJu0YwR6bnCydjX912Z5lzTJx0E/qWFwB6hvldRGDSWgkuA67S1y3Ee T3gFWdcZgBSLynd4561E45nQoUlkhSGwP92DFDWG7T8+Z1/Xdr5N X-Received: by 2002:a05:6000:c8:b0:33e:142f:7ca9 with SMTP id q8-20020a05600000c800b0033e142f7ca9mr1340932wrx.54.1709302682965; Fri, 01 Mar 2024 06:18:02 -0800 (PST) Received: from lola.. ([2a02:810d:7e40:14b0:d371:e319:5dd0:9b35]) by smtp.gmail.com with ESMTPSA id j13-20020adff00d000000b0033d06dfcf84sm4643368wro.100.2024.03.01.06.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 06:18:02 -0800 (PST) From: Lukas Bulwahn To: Jonathan Corbet , Mauro Carvalho Chehab , Vegard Nossum , Akira Yokosawa , Jani Nikula , Randy Dunlap , linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [PATCH v2] docs: drop the version constraints for sphinx and dependencies Date: Fri, 1 Mar 2024 15:18:00 +0100 Message-ID: <20240301141800.30218-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit As discussed (see Links), there is some inertia to move to the recent Sphinx versions for the doc build environment. As first step, drop the version constraints and the related comments. As sphinx depends on jinja2, jinja2 is pulled in automatically. So drop that. Then, the sphinx-pre-install script will fail though with: Can't get default sphinx version from ./Documentation/sphinx/requirements.txt at ./scripts/sphinx-pre-install line 305. The script simply expects to parse a version constraint with Sphinx in the requirements.txt. That version is used in the script for suggesting the virtualenv directory name. To suggest a virtualenv directory name, when there is no version given in the requirements.txt, one could try to guess the version that would be downloaded with 'pip install -r Documentation/sphinx/requirements.txt'. However, there seems no simple way to get that version without actually setting up the venv and running pip. So, instead, name the directory with the fixed name 'sphinx_latest'. Finally update the Sphinx build documentation to reflect this directory name change. Link: https://lore.kernel.org/linux-doc/874jf4m384.fsf@meer.lwn.net/ Link: https://lore.kernel.org/linux-doc/20240226093854.47830-1-lukas.bulwahn@gmail.com/ Reviewed-by: Akira Yokosawa Tested-by: Vegard Nossum Signed-off-by: Lukas Bulwahn --- v1 -> v2: drop jinja2 as suggested by Vegard. add tags from v1 review Documentation/doc-guide/sphinx.rst | 11 ++++++----- Documentation/sphinx/requirements.txt | 7 ++----- scripts/sphinx-pre-install | 19 +++---------------- 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/Documentation/doc-guide/sphinx.rst b/Documentation/doc-guide/sphinx.rst index 709e19821a16..8081ebfe48bc 100644 --- a/Documentation/doc-guide/sphinx.rst +++ b/Documentation/doc-guide/sphinx.rst @@ -48,13 +48,14 @@ or ``virtualenv``, depending on how your distribution packaged Python 3. on the Sphinx version, it should be installed separately, with ``pip install sphinx_rtd_theme``. -In summary, if you want to install Sphinx version 2.4.4, you should do:: +In summary, if you want to install the latest version of Sphinx, you +should do:: - $ virtualenv sphinx_2.4.4 - $ . sphinx_2.4.4/bin/activate - (sphinx_2.4.4) $ pip install -r Documentation/sphinx/requirements.txt + $ virtualenv sphinx_latest + $ . sphinx_latest/bin/activate + (sphinx_latest) $ pip install -r Documentation/sphinx/requirements.txt -After running ``. sphinx_2.4.4/bin/activate``, the prompt will change, +After running ``. sphinx_latest/bin/activate``, the prompt will change, in order to indicate that you're using the new environment. If you open a new shell, you need to rerun this command to enter again at the virtual environment before building the documentation. diff --git a/Documentation/sphinx/requirements.txt b/Documentation/sphinx/requirements.txt index 5d47ed443949..5017f307c8a4 100644 --- a/Documentation/sphinx/requirements.txt +++ b/Documentation/sphinx/requirements.txt @@ -1,6 +1,3 @@ -# jinja2>=3.1 is not compatible with Sphinx<4.0 -jinja2<3.1 -# alabaster>=0.7.14 is not compatible with Sphinx<=3.3 -alabaster<0.7.14 -Sphinx==2.4.4 +alabaster +Sphinx pyyaml diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install index de0de5dd676e..4c781617ffe6 100755 --- a/scripts/sphinx-pre-install +++ b/scripts/sphinx-pre-install @@ -280,8 +280,6 @@ sub get_sphinx_version($) sub check_sphinx() { - my $default_version; - open IN, $conf or die "Can't open $conf"; while () { if (m/^\s*needs_sphinx\s*=\s*[\'\"]([\d\.]+)[\'\"]/) { @@ -293,18 +291,7 @@ sub check_sphinx() die "Can't get needs_sphinx version from $conf" if (!$min_version); - open IN, $requirement_file or die "Can't open $requirement_file"; - while () { - if (m/^\s*Sphinx\s*==\s*([\d\.]+)$/) { - $default_version=$1; - last; - } - } - close IN; - - die "Can't get default sphinx version from $requirement_file" if (!$default_version); - - $virtenv_dir = $virtenv_prefix . $default_version; + $virtenv_dir = $virtenv_prefix . "latest"; my $sphinx = get_sphinx_fname(); if ($sphinx eq "") { @@ -318,8 +305,8 @@ sub check_sphinx() die "$sphinx didn't return its version" if (!$cur_version); if ($cur_version lt $min_version) { - printf "ERROR: Sphinx version is %s. It should be >= %s (recommended >= %s)\n", - $cur_version, $min_version, $default_version; + printf "ERROR: Sphinx version is %s. It should be >= %s\n", + $cur_version, $min_version; $need_sphinx = 1; return; } -- 2.43.2