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: Sun, 26 May 2024 23:15:50 +0900 Message-ID: References: <6057C283-20C5-4A91-9CD4-EBA521B8C893@gmail.com> <7CF65AE1-B3AC-40C5-AC82-CE575E5E1831@gmail.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14349"; 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 , Lin Sun , stefankangas@gmail.com, 70815@debbugs.gnu.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 26 16:18:26 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 1sBEhe-0003bC-JV for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 May 2024 16:18:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBEhG-0004S6-AA; Sun, 26 May 2024 10:18:02 -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 1sBEh8-0004Qm-1O for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 10:17:55 -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 1sBEh7-0006xb-NT for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 10:17:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sBEhF-0004HO-IF for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 10:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: kobarity Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 May 2024 14:18:01 +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.171673303016385 (code B ref 70815); Sun, 26 May 2024 14:18:01 +0000 Original-Received: (at 70815) by debbugs.gnu.org; 26 May 2024 14:17:10 +0000 Original-Received: from localhost ([127.0.0.1]:42241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBEgP-0004GD-VD for submit@debbugs.gnu.org; Sun, 26 May 2024 10:17:10 -0400 Original-Received: from mail-pf1-f178.google.com ([209.85.210.178]:59560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sBEgN-0004Fz-Vd for 70815@debbugs.gnu.org; Sun, 26 May 2024 10:17:08 -0400 Original-Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6f8ec7e054dso1548561b3a.2 for <70815@debbugs.gnu.org>; Sun, 26 May 2024 07:16:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716732954; x=1717337754; 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=lVC9fSIkQl0/jqQZ3sQcwixp/OztzEPVF4gRlhmEk3c=; b=nTfLB9Vce4TuOS938ZHfRhbdirpjDvJcvCW4eAQOmZRsoYHmlxck2iiJ3McB1SILse xor+NOc6DOhrx/MFp+Iy5rv/FrTPjahbEUsH2gZGqQYDhYvrWQxTTa8hd1nRWjzv7AD/ JygqRxc8DVrGsg8kaVXQJnldmNgEr/EYZU1M6SlwJnkdJgh5fp/uOiWG9E0Npwc8WrBm mYLeT7qDpLRUzAfROuE++AvKqRnPGSfEzMJ/wfKVKGpNU2fOiU4Fdia2BIryBv8CiLzC 2ZukfjGrMmytvh9kugF5TanEDQq2LwzIKI56OtdcwZClWnznUru1hWtRKscxjlRICVLB MbFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716732954; x=1717337754; 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=lVC9fSIkQl0/jqQZ3sQcwixp/OztzEPVF4gRlhmEk3c=; b=vNd9KtgFslGiutGzqEg+8SuD/oEHpeK27POBo48yY334gxmDkljAaun8gvW/EqcWQj zKR5V9f/n1yOltP8vAsUB+jCbKifXkZV3tGJfhw/NoIagdBt0FsRiaZQDFwcVoObiGLp qUrnhsxnZx3jsKVo3xkIDcxQdzYIj3YUhTueS6xn4GveD7P7unPuYGFq7k/6bAE4KvIt x3yg8OI/VFn4Lk2KdxHVXA6jjYSQsvMwU/TQDxS4NZUGl+0YqYPAZWW3zd8VwvM76DXA MXwGBCbad2tXwr5r+JOUrrAcTS0KOcBr8ujgB+vO/JMCxC11rMFi6ZLLzTT5hKgp6lOv eUrg== X-Forwarded-Encrypted: i=1; AJvYcCVVM5JYfO9lGCaBPtpABjqhc2C9gi4l32T1d5D3CB6FA0iVJtHfWllMGNlOGFjcRiFOId1QnGBUe/YQYSob0tcarJaxY9c= X-Gm-Message-State: AOJu0YyuX15zHeu/TYt6DLNFgoj/J6jH2KFnxKx0I/Tf8q8dGydV8tYD Cu+MO9UQunQs4HFhFqFd6/Fg74hxxiCnaIsHmBg8c5yeWHN+c6vR X-Google-Smtp-Source: AGHT+IEkOirPLuqR4CweSChENWLeKyZgqNXL2H/oyTGxoGMomT3QYFkVgJTqquhExrLo2mzQWa1htA== X-Received: by 2002:a05:6a20:9746:b0:1af:f514:6d96 with SMTP id adf61e73a8af0-1b212cfff98mr8478486637.16.1716732953507; Sun, 26 May 2024 07:15:53 -0700 (PDT) Original-Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fcfe664fsm3531444b3a.153.2024.05.26.07.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 07:15:53 -0700 (PDT) In-Reply-To: <7CF65AE1-B3AC-40C5-AC82-CE575E5E1831@gmail.com> 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:285965 Archived-At: Mattias Engdeg=E5rd wrote: >=20 > 26 maj 2024 kl. 14.36 skrev kobarity : >=20 > > Sorry, I forgot that native completion does not work on Mac, even with > > Python 3. What I wanted to know is if there is unexpected echo backs > > with Python 2 on Mac. >=20 > Not that I can see when running an interactive Python shell in Emacs, no. Could you see what is returned when you enter the following line in Inferior Python buffer running Python 2 on Mac? __PYTHON_EL_eval("print(\"Hello\")\n", "") > > Maybe it is better to prefer "python3", but I don't know if that would > > reliably prevent the problem. The best way would be to skip some > > tests if the selected interpreter is Python 2 and it is running on > > Mac. >=20 > Why select Python 2 in the first place? Is it more important to test Pyth= on 2 than Python 3 on other platforms? I am not saying that Python 2 (or simple "python") should be the first. I do agree that "python3" should be preferred than "python". My point is that we cannot assure that Python 2 is not selected. One example is EMACS_PYTHON_INTERPRETER environment variable introduced by the patch. It can specify the interpreter used in ERTs. So a Mac user may set EMACS_PYTHON_INTERPRETER to "python". I wrote in the previous mail: > 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. At the time of writing, I assumed that current ERTs can be run on both Python 2 and 3 on all platforms. However, it turned out that it was wrong. Some tests fail with Python 2 on Mac. So I think we need some mechanism to skip test based on the interpreter version and the platform.