From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: kobarity Newsgroups: gmane.emacs.bugs Subject: bug#70815: [PATCH] ; Enahnce python-tests.el to adapt different python interpreters Date: Wed, 22 May 2024 23:38:02 +0900 Message-ID: References: <86zfsmbb3b.fsf@gnu.org> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21486"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) Cc: Eli Zaretskii , Stefan Kangas , 70815@debbugs.gnu.org To: Lin Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 22 16:40:20 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 1s9n8e-0005JO-0q for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 May 2024 16:40:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s9n8I-0000g1-7B; Wed, 22 May 2024 10:39:58 -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 1s9n8G-0000fL-OY for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 10:39:56 -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 1s9n8G-0004xY-G8 for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 10:39:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s9n8M-0003h1-3W for bug-gnu-emacs@gnu.org; Wed, 22 May 2024 10:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 May 2024 14:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70815-submit@debbugs.gnu.org id=B70815.171638876214175 (code B ref 70815); Wed, 22 May 2024 14:40:02 +0000 Original-Received: (at 70815) by debbugs.gnu.org; 22 May 2024 14:39:22 +0000 Original-Received: from localhost ([127.0.0.1]:56321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9n7i-0003gZ-DV for submit@debbugs.gnu.org; Wed, 22 May 2024 10:39:22 -0400 Original-Received: from mail-pf1-f180.google.com ([209.85.210.180]:56346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s9n7d-0003gT-MY for 70815@debbugs.gnu.org; Wed, 22 May 2024 10:39:21 -0400 Original-Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6f67f4bebadso1355062b3a.0 for <70815@debbugs.gnu.org>; Wed, 22 May 2024 07:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716388686; x=1716993486; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=3RE/qoHKkhNQu3VuJZkYhyIrg41ZH/6Nddy9rPOga4E=; b=ClNVr+o6C9pZZCLO+fCwEs2rpGvvE5SCXqX5f1JA3vaX+vHp/TuyUxPzf8/okbq3Vk FBqajW5Wr4KutcPegcJawr0UcCeKQEkP/dzhdjZoQOWXnBYaKqThZNEQ21NGuf+4rEoY hvkHBeBAhSyZxdxyjwn5HaoN+PKZxMUYkO7s7eZYejzNxoxfbhhr9KCG3ENrJgKuF9+m WxovgjhZyCo9mhyZsSsv6gYWh11I6pqW9x2aSUancLrWWPBCmLeoRjlpulhuc/azsI/I tazeXKTXvPOzK1y4XEKtF7k+LAItNOWPO9JOLAPkkV6vTvh+hqf1vCXxuF4ibVFjuutN TnqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716388686; x=1716993486; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=3RE/qoHKkhNQu3VuJZkYhyIrg41ZH/6Nddy9rPOga4E=; b=GZ+KrnpQgyj6k7xwYa3sIyFU7xOFyQAO6xqNOYFKXNP/grI7QD7aFKxzWEg9o+OH/e gnDQkbM2Ii+Jpdv0/oc8USyd3r6O8vNmF8dQ2ccWwSmj8iBSD5jA/Ug2S2VyCvOi8+U+ uSnueC5SQUIqtXdAyBIgz4eYpeeE9PalxN+rUBR7HnmM+k/D+vnS23TWqOJf1SzqyULK INGjL3K4w2h6pzUr7rxmbDvkqCMnF51PaV9ir5LpyA6Z9ZF2q/nJc609KxC8OJxOTj7j qERwzw1e3L3tdrl3j8QWNqu7IRw/CFiqp/AyNeI8W2vd1BAZ9HXekOjOdLR+nPKo+v5o tClw== X-Forwarded-Encrypted: i=1; AJvYcCVichd/Wr4YgEAoCxUL8dgKd4F1szZ+kwT9Nefng7nBnXihlO+bTTXOaSXsnb9KWXxOTjOqHGnexZPHqkP7UJ0mtMmPx80= X-Gm-Message-State: AOJu0YzgjLjR7xedfPGti64/KoiBR9xIBqiZwvj+ts2akdCNttRT782w +HEPvhBB5yvJPYwH8qFQTwIOph+Ozvo3OX8nrXMI1hpc0jWFWYIw X-Google-Smtp-Source: AGHT+IHvBRBap18RpizQDTTKrVKYQJJING4XQJcrQh8tc1O2FWDS2G6NUEmYdQjAWEqIVVp7Ru+yYg== X-Received: by 2002:a05:6a20:8417:b0:1a9:c4cc:721d with SMTP id adf61e73a8af0-1b1f8a8799fmr2560995637.57.1716388685728; Wed, 22 May 2024 07:38:05 -0700 (PDT) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-64f0e60602dsm14312898a12.31.2024.05.22.07.38.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 07:38:05 -0700 (PDT) In-Reply-To: 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:285631 Archived-At: Lin Sun wrote: > On Tue, May 21, 2024 at 2:04=E2=80=AFPM kobarity wro= te: > > > > > > Lin Sun wrote: > > > On Mon, May 20, 2024 at 3:53=E2=80=AFPM 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 t= o 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 mas= ter > > > > 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 we= ll. > > > > > > > > > > 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 n= eed > > > > > 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 m= essage. > > > 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. >=20 > Merged your changes and tested on my local (with python/python3), it > works perfectly. Thank you. >=20 > And the patch file is attached . Thanks, it looks good to me.