From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9DEB6A04DD; Thu, 22 Oct 2020 04:30:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 883449AF4; Thu, 22 Oct 2020 04:30:21 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 41CE972E8 for ; Thu, 22 Oct 2020 04:30:19 +0200 (CEST) IronPort-SDR: 3wmYXLxTwn9wlyexrdbmIe+0QR6YVybDgseI689T2PCHpBj+fehURkf/P8fB7yGSllo9G6E5vO /omCkBMJKy5A== X-IronPort-AV: E=McAfee;i="6000,8403,9781"; a="229084798" X-IronPort-AV: E=Sophos;i="5.77,403,1596524400"; d="scan'208";a="229084798" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2020 19:30:13 -0700 IronPort-SDR: 1xQ5USXYrzQ0Du2jf7af10lLqgA3pmce2H104Y8FlddzeavBlp7B8B9bVMS4L5T1MsS9X7sTv5 odf4qDFKJIQg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,403,1596524400"; d="scan'208";a="533768802" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga005.jf.intel.com with ESMTP; 21 Oct 2020 19:30:13 -0700 Received: from shsmsx602.ccr.corp.intel.com (10.109.6.142) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 21 Oct 2020 19:30:12 -0700 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by SHSMSX602.ccr.corp.intel.com (10.109.6.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Thu, 22 Oct 2020 10:30:10 +0800 Received: from shsmsx605.ccr.corp.intel.com ([10.109.6.215]) by SHSMSX605.ccr.corp.intel.com ([10.109.6.215]) with mapi id 15.01.1713.004; Thu, 22 Oct 2020 10:30:10 +0800 From: "Mo, YufengX" To: "Tu, Lijuan" , "dts@dpdk.org" , "Ma, LihongX" Thread-Topic: [dts] [PATCH V2 1/3] framework: check the python version Thread-Index: AQHWofpj8GQrgFRv2UChXkExR3sgjKmi2tyQgAAXiAA= Date: Thu, 22 Oct 2020 02:30:10 +0000 Message-ID: References: <20201014071448.32119-1-yufengx.mo@intel.com> <20201014071448.32119-2-yufengx.mo@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dts] [PATCH V2 1/3] framework: check the python version X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" So, checking python version > 3.6.0 is what you want to do? > -----Original Message----- > From: Tu, Lijuan > Sent: Thursday, October 22, 2020 9:18 AM > To: Mo, YufengX ; dts@dpdk.org; Ma, LihongX > Cc: Mo, YufengX > Subject: RE: [dts] [PATCH V2 1/3] framework: check the python version >=20 > DTS only support Python3 now, it doesn't support Python2. But it requires= Python minus version. E.g. Python3.4 is not supported, it > requires version larger than 3.6x. >=20 > > +def check_crb_python_version(crb): > > + cmd =3D 'python3 -V' >=20 > It seems you are telling python version for python 3. If you are using py= thon3, how can it tell you python2. >=20 > > + out =3D crb.send_expect(cmd, '#', 5) > > + pat =3D "Python (\d+).(\d+).(\d+)" > > + result =3D re.findall(pat, out) > > + if not result or int(result[0][0]) < 3: > > + crb.logger.warning( > > + ("WARNING: Tester node python version is lower than python= 3, " > > + "it is deprecated for use in DTS, " > Python2 have been replaced by Python2 in DTS, so the message is not reaso= nable. >=20 > > + "and will not work in future releases.")) > > + crb.logger.warning("Please use Python 3 instead") > > + > > + > > +def check_dts_python_version(): > > + if sys.version_info.major < 3: > > + print(RED( > > + ("WARNING: Dts running node python version is lower than p= ython 3, " > > + "it is deprecated for use in DTS, " > > + "and will not work in future releases.")), file=3Dsys.std= err) > > + print(RED("Please use Python 3 instead"), file=3Dsys.stderr) > > -- > > 2.21.0