unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: Tomi Ollila <tomi.ollila@iki.fi>
Cc: notmuch@notmuchmail.org
Subject: [PATCH v2] configure: check for pytest with python -m pytest
Date: Tue, 28 Jul 2020 07:28:16 +0700	[thread overview]
Message-ID: <20200728002816.GC7409@danh.dev> (raw)
In-Reply-To: <m2a6zksvuh.fsf@guru.guru-group.fi>

On 2020-07-27 20:37:10+0300, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Mon, Jul 27 2020, Đoàn Trần Công Danh wrote:
> 
> > On different distro, pytest is suffixed with different patterns.
> > Try to account for them, now.
> >
> > Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> > ---
> >  configure | 13 +++++++++----
> >  1 file changed, 9 insertions(+), 4 deletions(-)
> >
> > diff --git a/configure b/configure
> > index db3538b3..90bc9182 100755
> > --- a/configure
> > +++ b/configure
> > @@ -814,10 +814,15 @@ if [ $have_python3 -eq 1 ]; then
> >      printf "Checking for python3 pytest (>= 3.0)... "
> >      conf=$(mktemp)
> >      printf "[pytest]\nminversion=3.0\n" > $conf
> > -    if pytest-3 -c $conf --version >/dev/null 2>&1; then
> > -        printf "Yes.\n"
> > -        have_python3_pytest=1
> > -    else
> > +    for _pytest_cmd in pytest-3 pytest3; do
> 
> We use `${NOTMUCH_PYTHON} -m pytest` in tests to run the python
> tests. IMO it would be better to change this check to do the
> same with already resolved python3 command.

Yes, that's definitely better option, I also use that command in other
code base, but forgot to take it here.

This is the updated patch:
-----------------------8<----------------------
From c6d8681d467bef9fe43c039ed1e2e467b99b6c56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Mon, 27 Jul 2020 16:42:02 +0700
Subject: [PATCH v2] configure: check for pytest with python -m pytest
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On different distro, pytest is suffixed with different patterns.

On the other hand, `python3-pytest' could be invoked correctly,
via `python3 -m pytest', the latter is used by our tests, now.

Switch to `$python -m pytest` to fix address all incompatible naming.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index db3538b3..f7c1c095 100755
--- a/configure
+++ b/configure
@@ -814,7 +814,7 @@ if [ $have_python3 -eq 1 ]; then
     printf "Checking for python3 pytest (>= 3.0)... "
     conf=$(mktemp)
     printf "[pytest]\nminversion=3.0\n" > $conf
-    if pytest-3 -c $conf --version >/dev/null 2>&1; then
+    if "$python" -m pytest -c $conf --version >/dev/null 2>&1; then
         printf "Yes.\n"
         have_python3_pytest=1
     else
-- 
2.28.0.rc2.21.g5c06d60fc5\r

  reply	other threads:[~2020-07-28  0:28 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 15:41 [PATCH] configure: detect version by compiler for build Đoàn Trần Công Danh
2020-07-27 15:41 ` [PATCH] configure: account for various name of pytest-3 Đoàn Trần Công Danh
2020-07-27 17:37   ` Tomi Ollila
2020-07-28  0:28     ` Đoàn Trần Công Danh [this message]
2020-07-27 15:41 ` [PATCH] configure: drop check for default xapian backend Đoàn Trần Công Danh
2020-07-28 11:17   ` David Bremner
2020-07-28 13:36     ` Đoàn Trần Công Danh
2020-07-30  0:05       ` David Bremner
2020-07-31 13:49         ` Đoàn Trần Công Danh
2020-07-31 14:41           ` David Bremner
2020-07-27 15:41 ` [PATCH] T355: specify hash algorithm explicitly Đoàn Trần Công Danh
2020-07-27 17:00   ` Đoàn Trần Công Danh
2020-07-27 17:40   ` Tomi Ollila
2020-07-27 23:42     ` Đoàn Trần Công Danh
2020-07-27 17:31 ` [PATCH] configure: detect version by compiler for build Tomi Ollila
2020-07-28  0:18   ` Đoàn Trần Công Danh
2020-07-28 11:25     ` David Bremner
2020-07-28 13:43       ` Đoàn Trần Công Danh
2020-08-03 15:40 ` [PATCH v2] configure: check for pytest with python -m pytest Đoàn Trần Công Danh
2020-08-07 17:12   ` Tomi Ollila
2020-08-08 19:14     ` David Bremner
2020-08-03 15:40 ` [PATCH v2] configure: drop check for default xapian backend Đoàn Trần Công Danh
2020-08-03 15:40 ` [PATCH v2] T355: specify hash algorithm explicitly Đoàn Trần Công Danh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200728002816.GC7409@danh.dev \
    --to=congdanhqx@gmail.com \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).