Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4161164ybf; Tue, 3 Mar 2020 21:42:42 -0800 (PST) X-Google-Smtp-Source: ADFU+vvVffpHlbEjyWJ/1paP/XI35m/3RB2bciGsLmwB2bMvCCnBsfloQtyRq+Mw6mfYWv7X8M7H X-Received: by 2002:a05:6830:15c6:: with SMTP id j6mr1048835otr.348.1583300562699; Tue, 03 Mar 2020 21:42:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583300562; cv=none; d=google.com; s=arc-20160816; b=kCbiWzOdFnqQdQWOy2myRl8G4pKShphRrCx+mw+tPx2A1/NixijJuJaEXZBdlUILD+ spiENM3B0OAzz7oD9Mq9M4uZ6g7giNNTWtV06cbKiNNvp6Xr2U7ZZMdNdbK6UAGwe/Ls h8Bs6cslGgsYVh2ccv+SvrWDM+nSL5nJa0Yvhd5yq4qW1rJ5Fya66yv4JClNaAxxLcPO nZNQLgy5gl2xop4I5dl18ZJr+Cree2Rff5+UJCRB8gVo7nKwpyxwypZarI8BbD3x0oEy Sj6m3McBnkfGu/+WZgDvC7MRmD197q+zQtHRZ6rfgMmALlfYgbKLWM9QjdDCFnpq4E2v 14aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ZULxUqGZhfqiCtOPUcghJlJaP8Hs0gOp+7qzdww37IE=; b=lywi0X6jz0FHqYFDuLHABeiqw2UC7tQ8fTuV3aBJj4l65Aae3mBqUDq398zeyKqomC KhZHgatfqfVhxGCIyHTqmmEpq+oGcU0KwsGSQVJxMVZ+VKbv/gwjaa3R0cDrd/pLcTVN LfRXU1CE4/EZItW7VKO+R71saQNDyPN0lODnzXQwiFjmSn0h7vHtFYE3L7UYS3xgRZWC 82vEBBocavAIghelh5fuSr1M1KiqDRbvY+PN7mE8JuFRcwvlduhY/DrwwPlQrdgOHHlt OnmaV1s/dKyuzm1fcBIXyab3pDdWXZ8UXa+L42bK0nDvVAkGZ9tKXZhQpXcPQww3dw30 MUVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YJkd6I7+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23si548753otd.203.2020.03.03.21.42.28; Tue, 03 Mar 2020 21:42:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YJkd6I7+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726243AbgCDFmT (ORCPT + 99 others); Wed, 4 Mar 2020 00:42:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:37002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725971AbgCDFmT (ORCPT ); Wed, 4 Mar 2020 00:42:19 -0500 Received: from onda.lan (ip5f5ad4e9.dynamic.kabel-deutschland.de [95.90.212.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 385DA214D8; Wed, 4 Mar 2020 05:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583300538; bh=XnZr+3j6ZAuKpc/58P3pJj3X9aigMNVKC6LrvVhvag0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YJkd6I7+vjjhVlFWBda9F/DrWXkuGESju6H5wgK9p1dE3HnNWqsHcT7WICHT7zVsL pc3ZxDclxFaVRt4SG+YPIJYh5sitWAcLRVw/+H589KqITLt4wL9uIlORy23MdNGZ7f //qeV01LAYVbiXPLYDKIvCTqaSQ2zzw8aW3fKuWM= Date: Wed, 4 Mar 2020 06:42:14 +0100 From: Mauro Carvalho Chehab To: "Bird, Tim" Cc: Jonathan Corbet , "tbird20d@gmail.com" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] scripts/sphinx-pre-install: add '-p python3' to virtualenv Message-ID: <20200304064214.64341a49@onda.lan> In-Reply-To: References: <1582594481-23221-1-git-send-email-tim.bird@sony.com> <20200302130911.05a7e465@lwn.net> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, 3 Mar 2020 17:07:48 +0000 "Bird, Tim" escreveu: > > -----Original Message----- > > From: Jonathan Corbet > > > > On Mon, 24 Feb 2020 18:34:41 -0700 > > tbird20d@gmail.com wrote: > > > > > With Ubuntu 16.04 (and presumably Debian distros of the same age), > > > the instructions for setting up a python virtual environment should > > > do so with the python 3 interpreter. On these older distros, the > > > default python (and virtualenv command) might be python2 based. > > > > > > Some of the packages that sphinx relies on are now only available > > > for python3. If you don't specify the python3 interpreter for > > > the virtualenv, you get errors when doing the pip installs for > > > various packages > > > > > > Fix this by adding '-p python3' to the virtualenv recommendation > > > line. > > > > > > Signed-off-by: Tim Bird > > > > I've applied this, even though it feels a bit fragile to me. But Python > > stuff can be a bit that way, sometimes, I guess. > > I agree it seems a bit wonky. Well, we could, instead, add some code that would be checking python and pip versions, but still distros could be doing some backports with could cause side-effects. So, checking for distro versions as done in this patch seems a lot safer. > The less fragile approach would have been to just > always add the '-p python3' option to the virtualenv setup hint, > but Mauro seemed to want something more fine-tuned. Yeah, I asked for a more fine-tuned version. Depending on python/pip version, adding a -p python3 seems to cause troubles (at least I found some bug reports about that). I may be wrong (it was a long time ago), but, before adding the logic that checks for "python3" I guess I tried first add -p python3, but, back then, I found some troubles (probably with some old Fedora version). So, better to use this syntax only on distros we know it will work as expected. > As far as the string parsing goes, I think that the format of strings > returned by lsb-release (and the predecesors that sphinx_pre_install > checks) is unlikely to change. Since when we added this script, we didn't have any troubles yet with the part of the code with checks the distribution version. So, I guess that the lsb-release related checks are pretty much reliable. > > Thanks for applying it. > -- Tim > >