Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp212234pxj; Thu, 17 Jun 2021 00:41:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1WVLC0sGZbxP9hWnzgA2LnR23ozVjhlBi5gHEk2KiEqBGZVOj2xkjAgvIUSGRacJZo4vh X-Received: by 2002:a6b:f618:: with SMTP id n24mr2765300ioh.174.1623915661093; Thu, 17 Jun 2021 00:41:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623915661; cv=none; d=google.com; s=arc-20160816; b=ZKCxkdbBgQvRRu1PT1MIralytY8ao/PCH7T5Gjdol6saNbWUR1nXGSdg83zyzoOqi1 TrliVcb2PPWxPbY3ptESX1pGxtsI6fjeitunZ0X995Fg6uoehIZjBSqKTLlFJqqkngAC rTgfFNKP70NPzLi0UzU/+PwAUF/kGZJCo4MHtIUGnYrM/TVWdGMOrJm/wlunQalUnNdl lKJd7uYvoSEp2z9/FZxMSDY7cz3WltkpAGxR0N+M0eqwyhrKL343XO0F9Y7ZQlOXqrcN ePQQ2V/5JW+8dVnWY3MbSO0qvbpAnZ3UScElqfRf0ZrlaaUF5G3/toGMXWbChQPig5zi WFtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ED2e7Wgol5pRGJlXkx0YLNBo6OPWV74DLlbsM0kwoRE=; b=0BuhBu3fytOMaT8ZlLCP9f3J17eGJlsl0MdSBvjjjOdMUyvsMCam7sT+LKT0+MEIC3 09f07Gwmg/pAtBijqXpaRJOeYo9mCsecFtk/PqDvvcURaUqlG9lTIlrEUJinbafJPyK0 tcawCQDJJj5/HyyN3TKaDV05j+xW7DBeQPjRGKRaPXqhx76tSADp3kXxS2gRnf1raHqT Vm2rL/bmE5itIkzbR1/8yzbhcdQ/upSGM8OQMncNDw1uWxCUYg9ZIQdmCUGnA7lahvhl KvBm3sDtwBDWWPHnSbk7I0PY9Rem9Bi7EIZ2MVccM5EVvHmY8VK5oCYx0R5RoQ+1S5rM UF7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tIjQxXZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si5675557ilq.138.2021.06.17.00.40.49; Thu, 17 Jun 2021 00:41:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tIjQxXZK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229782AbhFQHmG (ORCPT + 99 others); Thu, 17 Jun 2021 03:42:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229714AbhFQHmE (ORCPT ); Thu, 17 Jun 2021 03:42:04 -0400 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76F01C061574; Thu, 17 Jun 2021 00:39:46 -0700 (PDT) Received: by mail-qk1-x734.google.com with SMTP id j62so2173287qke.10; Thu, 17 Jun 2021 00:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to; bh=ED2e7Wgol5pRGJlXkx0YLNBo6OPWV74DLlbsM0kwoRE=; b=tIjQxXZKcQpI+3A7PE8/2BctELfZdYi+TsZ7DiAtYr9AQVBJFXdj1hlRTKlj+cV+Cu uLErhf7rbzXCGFeCsyu1eVtUebHvQJntOzGJHUyIzGgkzS3TPYSV7vDfGEWf+vu9n2sJ I0UwTeYmYWTWvvlLjvkriAP4YMqF8gbae4PMeFGPPk1B3RlgyKhvjoCewNhFwXHWXVUR On30GIb5Adqxkw9K0noWztie7q257TQax7/mu8PDWVI6c350JQFiAT9H4IMESMTcd7Gr JB7TfIsZm3GJLKvrw4jcX1wZ6yKBQQTPSqsFUz5+MWG8CpYnOdUJxGYSugRCvnrXZBIS IOww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to; bh=ED2e7Wgol5pRGJlXkx0YLNBo6OPWV74DLlbsM0kwoRE=; b=UqXzA4qhMipIFg6nD4YQvAuwllWAp637nSr8V7bO5hTfuxUcKTpBIoT61UEuYjnf7f 4Z2lQ+Lm6tkR/19hLjhE8hWMnJbgfr5yggwIs1RufrKTvU6dor7og4Hlh8vmfay3eCij ckLTwVD/jaba7GuIT9dvILfM76ocOjZ+u3Dq4Fpo2Yj8kcSDrel5Az0OV+larAblG5O2 kQmqWJtjN8r1a/fqJbIhzMJLicwROYHw55x4aNiKmtVMDhQ4YT95ld/tu+iRoq4lTYtW QxdmUMjf6A8BtHwCK9F81xipYcdlUEUEObp/N2oZCl54ShlBpyHnJ5UaGD6/fnLF+G1Q dGfg== X-Gm-Message-State: AOAM533FARqY+oe31JiJWKDjm5pygqXwCAKEtQK4AUJRZFPu16ZOg00h 5j529TiSIJIFFMGptZ6y6d8= X-Received: by 2002:a37:684c:: with SMTP id d73mr2372805qkc.35.1623915585608; Thu, 17 Jun 2021 00:39:45 -0700 (PDT) Received: from localhost.localdomain (ec2-35-169-212-159.compute-1.amazonaws.com. [35.169.212.159]) by smtp.gmail.com with ESMTPSA id y195sm1234580qkb.69.2021.06.17.00.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 00:39:44 -0700 (PDT) From: SeongJae Park X-Google-Original-From: SeongJae Park To: Daniel Latypov Cc: SeongJae Park , Brendan Higgins , "open list:KERNEL SELFTEST FRAMEWORK" , KUnit Development , Linux Kernel Mailing List , SeongJae Park Subject: Re: [PATCH] kunit: tool: Assert version requirement Date: Thu, 17 Jun 2021 07:39:37 +0000 Message-Id: <20210617073937.16281-1-sjpark@amazon.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: SeongJae Park Hello Daniel, On Wed, 16 Jun 2021 14:14:40 -0700 Daniel Latypov wrote: > On Wed, Jun 16, 2021 at 2:40 AM SeongJae Park wrote: > > > > From: SeongJae Park > > > > 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 > > 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 > > assert sys.version_info >= (3, 7) > > AssertionError > > > > Signed-off-by: SeongJae Park > > Acked-by: Daniel Latypov 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 > 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.