GNU bug report logs - #70815
[PATCH] ; Enahnce python-tests.el to adapt different python interpreters

Previous Next

Package: emacs;

Reported by: Lin Sun <sunlin7.mail <at> gmail.com>

Date: Tue, 7 May 2024 06:54:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#70815: closed ([PATCH] ; Enahnce python-tests.el to adapt
 different python interpreters)
Date: Thu, 23 May 2024 13:10:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 23 May 2024 16:09:01 +0300
with message-id <86ikz44qvm.fsf <at> gnu.org>
and subject line Re: bug#70815: [PATCH] ; Enahnce python-tests.el to adapt different python interpreters
has caused the debbugs.gnu.org bug report #70815,
regarding [PATCH] ; Enahnce python-tests.el to adapt different python interpreters
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
70815: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70815
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Lin Sun <sunlin7.mail <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] ;
 Enahnce python-tests.el to adapt different python interpreters
Date: Tue, 7 May 2024 06:53:05 +0000
[Message part 3 (text/plain, inline)]
Hi,
The python-tests.el will fail on finding interpreter "python" for
there is no "python"  on CentOS8, Ubuntu 20.04,  only "python3" exists
after installation.

And the patch will try to search python/python3/python2 as the python
testing interpreter; it also support a env var
"EMACS_PYTHON_INTERPRETER" to switch between different version of
python (eg: python3.6, python3.11, ...).

Please help review the  enhancement in "python-tests.el". Thanks.
[0001-Enahnce-python-tests.el-to-adapt-different-python-in.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: kobarity <kobarity <at> gmail.com>
Cc: sunlin7.mail <at> gmail.com, stefankangas <at> gmail.com, 70815-done <at> debbugs.gnu.org
Subject: Re: bug#70815: [PATCH] ;
 Enahnce python-tests.el to adapt different python interpreters
Date: Thu, 23 May 2024 16:09:01 +0300
> Date: Wed, 22 May 2024 23:38:02 +0900
> From: kobarity <kobarity <at> gmail.com>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,
> 	Stefan Kangas <stefankangas <at> gmail.com>,
> 	70815 <at> debbugs.gnu.org
> 
> 
> Lin Sun wrote:
> > On Tue, May 21, 2024 at 2:04 PM kobarity <kobarity <at> gmail.com> wrote:
> > >
> > >
> > > Lin Sun wrote:
> > > > On Mon, May 20, 2024 at 3:53 PM kobarity <kobarity <at> gmail.com> wrote:
> > > > > Eli Zaretskii wrote:
> > > > > > > Cc: kobarity <kobarity <at> gmail.com>
> > > > > > > From: Stefan Kangas <stefankangas <at> gmail.com>
> > > > > > > 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.


This bug report was last modified 1 year and 40 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.