All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj38.park@gmail.com>
To: Daniel Latypov <dlatypov@google.com>
Cc: SeongJae Park <sj38.park@gmail.com>,
	Brendan Higgins <brendanhiggins@google.com>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	KUnit Development <kunit-dev@googlegroups.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	SeongJae Park <sjpark@amazon.de>
Subject: Re: [PATCH] kunit: tool: Assert version requirement
Date: Thu, 17 Jun 2021 07:39:37 +0000	[thread overview]
Message-ID: <20210617073937.16281-1-sjpark@amazon.de> (raw)
In-Reply-To: <CAGS_qxo4L+Z=Z4ZRQ+z6BP2A6v2two5WyjMmLfTE0a=e0y1OAg@mail.gmail.com>

From: SeongJae Park <sjpark@amazon.de>

Hello Daniel,

On Wed, 16 Jun 2021 14:14:40 -0700 Daniel Latypov <dlatypov@google.com> wrote:

> On Wed, Jun 16, 2021 at 2:40 AM SeongJae Park <sj38.park@gmail.com> wrote:
> >
> > From: SeongJae Park <sjpark@amazon.de>
> >
> > Commit 87c9c1631788 ("kunit: tool: add support for QEMU") on the 'next'
> > tree adds 'from __future__ import annotations' in 'kunit_kernel.py'.
> > Because it is supported on only >=3.7 Python, people using older Python
> > will get below error:
> 
> Ah, we had been fine with just using 3.6 before this (and could have
> dropped down to 3.5 with a few lines changed).
> 
> But 3.7 came out initially in 2018*, so I assume we're probably fine
> to rely on that in kunit tool.
> *https://www.python.org/downloads/release/python-370/

Agreed.

> 
> >
> >     Traceback (most recent call last):
> >       File "./tools/testing/kunit/kunit.py", line 20, in <module>
> >         import kunit_kernel
> >       File "/home/sjpark/linux/tools/testing/kunit/kunit_kernel.py", line 9
> >         from __future__ import annotations
> >         ^
> >     SyntaxError: future feature annotations is not defined
> >
> > This commit adds a version assertion in 'kunit.py', so that people get
> > more explicit error message like below:
> >
> >    Traceback (most recent call last):
> >       File "./tools/testing/kunit/kunit.py", line 15, in <module>
> >         assert sys.version_info >= (3, 7)
> >     AssertionError
> >
> > Signed-off-by: SeongJae Park <sjpark@amazon.de>
> 
> Acked-by: Daniel Latypov <dlatypov@google.com>

Thank you! :)

> 
> > ---
> >  tools/testing/kunit/kunit.py | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/testing/kunit/kunit.py b/tools/testing/kunit/kunit.py
> > index be8d8d4a4e08..748d88178506 100755
> > --- a/tools/testing/kunit/kunit.py
> > +++ b/tools/testing/kunit/kunit.py
> > @@ -12,6 +12,8 @@ import sys
> >  import os
> >  import time
> >
> > +assert sys.version_info >= (3, 7)
> 
> Do we perhaps want
>   assert sys.version_info >= (3, 7), "Python version is too old"
> 
> Then the error message would be
>   Traceback (most recent call last):
>     File "./tools/testing/kunit/kunit.py", line 15, in <module>
>       assert sys.version_info >= (3, 7), "Python version is too old"
>   AssertionError: Python version is too old

That looks easier to understand.  I will post v2 in reply to this.


Thanks,
SeongJae Park

> 
> I assume kernel devs know some Python, but not necessarily that
> sys.version_info == "my python version"
> 
> > +
> >  from collections import namedtuple
> >  from enum import Enum, auto
> >
> > --
> > 2.17.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "KUnit Development" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to kunit-dev+unsubscribe@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/kunit-dev/20210616094033.18246-1-sj38.park%40gmail.com.

  reply	other threads:[~2021-06-17  7:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  9:40 [PATCH] kunit: tool: Assert version requirement SeongJae Park
2021-06-16 21:14 ` Daniel Latypov
2021-06-17  7:39   ` SeongJae Park [this message]
2021-06-17  7:46     ` [PATCH v2] kunit: tool: Assert the " SeongJae Park
2021-06-22 23:28       ` Daniel Latypov
2021-06-22 23:55         ` Daniel Latypov
2021-06-28 13:37           ` SeongJae Park
2021-06-28 19:51             ` Brendan Higgins
2021-06-28 19:41       ` Brendan Higgins
2021-07-12 19:42         ` Shuah Khan
2021-07-12 19:47           ` SeongJae Park
2021-07-12 19:52           ` [PATCH v3] " SeongJae Park

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

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

  git send-email \
    --in-reply-to=20210617073937.16281-1-sjpark@amazon.de \
    --to=sj38.park@gmail.com \
    --cc=brendanhiggins@google.com \
    --cc=dlatypov@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=sjpark@amazon.de \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.