From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70815: [PATCH] ; Enahnce python-tests.el to adapt different python interpreters Date: Thu, 23 May 2024 16:09:01 +0300 Message-ID: <86ikz44qvm.fsf@gnu.org> References: <86zfsmbb3b.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14642"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sunlin7.mail@gmail.com, stefankangas@gmail.com, 70815-done@debbugs.gnu.org To: kobarity Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 23 15:10:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sA8D3-0003VJ-TN for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 23 May 2024 15:10:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sA8Cq-0004G7-7z; Thu, 23 May 2024 09:10:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sA8Ck-0004FW-0A for bug-gnu-emacs@gnu.org; Thu, 23 May 2024 09:09:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sA8Ch-0006Oa-BG for bug-gnu-emacs@gnu.org; Thu, 23 May 2024 09:09:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sA8Cn-0002Tm-Lm for bug-gnu-emacs@gnu.org; Thu, 23 May 2024 09:10:01 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 May 2024 13:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 70815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 70815@debbugs.gnu.org, eliz@gnu.org, sunlin7.mail@gmail.com Original-Received: via spool by 70815-done@debbugs.gnu.org id=D70815.17164697599511 (code D ref 70815); Thu, 23 May 2024 13:10:01 +0000 Original-Received: (at 70815-done) by debbugs.gnu.org; 23 May 2024 13:09:19 +0000 Original-Received: from localhost ([127.0.0.1]:59042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sA8C7-0002TL-8e for submit@debbugs.gnu.org; Thu, 23 May 2024 09:09:19 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sA8C5-0002TF-Jy for 70815-done@debbugs.gnu.org; Thu, 23 May 2024 09:09:18 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sA8Bt-0006L8-TF; Thu, 23 May 2024 09:09:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=9Hn7rfR9dwxwONNbd1VlsHoXgMNzTgOmjKsO5hXFDus=; b=UGXkigWpwbEd5f5M+qrL Xij66UD3srBFpaWyHKd0GEA9JlrJWHsOGIO1oXFkk3pGAqez6JBqRyJNXC9tpHyCtjWOjrQCO78Lg DkxJ+1+n4lVp+9E09qzAJFm60Tax1jZYk67qhL6hv2U6lo0g73T2Z3fUY9uoCnyyJrE4bNBrl6NP/ jfh694jbHVoh527ny/kDNdBkzVVFVyPUF10GNtu6rjOiX/rTobggBH4LFLZOAaVBNTsBmiIFrVFmo 3NPv8cOmM/ekMM9mFf+4jC7tKRBbMwnhqLeYZ3FGVIMHFSZOZCmZZG+0JELJTrRdERXINmwznc/lw 1bXhofhpBzvsEA==; In-Reply-To: (message from kobarity on Wed, 22 May 2024 23:38:02 +0900) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:285702 Archived-At: > Date: Wed, 22 May 2024 23:38:02 +0900 > From: kobarity > Cc: Eli Zaretskii , > Stefan Kangas , > 70815@debbugs.gnu.org > > > Lin Sun wrote: > > On Tue, May 21, 2024 at 2:04 PM kobarity wrote: > > > > > > > > > Lin Sun wrote: > > > > On Mon, May 20, 2024 at 3:53 PM kobarity wrote: > > > > > Eli Zaretskii wrote: > > > > > > > Cc: kobarity > > > > > > > From: Stefan Kangas > > > > > > > Date: Sat, 18 May 2024 22:20:44 +0000 > > > > > > > > > > > > > > It makes sense to look for "python3", but is it really useful to look > > > > > > > for "python2" at this point? > > > > > > I don't think we want to drop Python 2.x support, not yet. > > > > > > > > > > I don't want to drop Python 2 support either, but I don't think the > > > > > addition of the "python2" command is mandatory. As the current master > > > > > does not run the "python2" command either. However, I don't think it > > > > > is a bad idea to add the "python2" command. > > > > > > > > > > Lin Sun wrote: > > > > > > Hi, > > > > > > I attached the latest patch, hope it resolved all your concerns. > > > > > > > > > > Hi Lin, > > > > > There is still a typo "Enahnce" in the summary line, and there is a > > > > > typo in the docstring of `python-tests-get-shell-interpreter' as well. > > > > > > > > > > > > If there is only python2 in the PATH and no python or python3, some tests will fail. > > > > > > It's caused by the python.el didn't search "python2", so it may need > > > > > > another patch to change python.el. > > > > > > > > > > I don't think so. Attached is a diff to your patch to resolve this > > > > > issue. It let-binds `python-shell-interpreter' in some ERTs. It > > > > > also includes the fix of the typo in the docstring of > > > > > `python-tests-get-shell-interpreter'. > > > > > > > > > > Without these modifications, EMACS_PYTHON_INTERPRETER will not work as > > > > > expected either on those ERTs. > > > > > > > > > > As for EMACS_PYTHON_INTERPRETER, I am a little doubtful that it is the > > > > > right thing to introduce. It allows the ERT runner to specify the > > > > > interpreter. It's OK for ERTs that can be run on both Python 2 and 3, > > > > > but you may want to write an ERT that can only be run on Python 3. > > > > > > > > Thank you for the comments, now get your points and agree with you. > > > > I merged your patch together, also corrected the typo in the commit message. > > > > Please help review the attached patch. Thank you ! > > > > > > Sorry, there was a problem in my diff. Two tests fail when > > > EMACS_PYTHON_INTERPRETER is not found. Please apply the attached > > > diff. It also includes a suggestion for improving the error message. > > > Please consider. > > > > Merged your changes and tested on my local (with python/python3), it > > works perfectly. Thank you. > > > > And the patch file is attached . > > Thanks, it looks good to me. Thanks, installed on master, and closing.