[dts] [PATCH V2 1/3] framework: check the python version

Tu, Lijuan lijuan.tu at intel.com
Thu Oct 22 04:53:30 CEST 2020


Hi Lihong,
Investigation of  what's python version DTS support need to be completed first.

> -----Original Message-----
> From: Mo, YufengX <yufengx.mo at intel.com>
> Sent: 2020年10月22日 10:30
> To: Tu, Lijuan <lijuan.tu at intel.com>; dts at dpdk.org; Ma, LihongX
> <lihongx.ma at intel.com>
> Subject: RE: [dts] [PATCH V2 1/3] framework: check the python version
> 
> 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 <yufengx.mo at intel.com>; dts at dpdk.org; Ma, LihongX
> > <lihongx.ma at intel.com>
> > Cc: Mo, YufengX <yufengx.mo at intel.com>
> > Subject: RE: [dts] [PATCH V2 1/3] framework: check the python version
> >
> > 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.
> >
> > > +def check_crb_python_version(crb):
> > > +    cmd = 'python3 -V'
> >
> > It seems you are telling python version for python 3. If you are using python3,
> how can it tell you python2.
> >
> > > +    out = crb.send_expect(cmd, '#', 5)
> > > +    pat = "Python (\d+).(\d+).(\d+)"
> > > +    result = 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
> reasonable.
> >
> > > +             "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 python 3,
> "
> > > +             "it is deprecated for use in DTS, "
> > > +             "and will not work in future releases.")), file=sys.stderr)
> > > +        print(RED("Please use Python 3 instead"), file=sys.stderr)
> > > --
> > > 2.21.0



More information about the dts mailing list