qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Require Python 3.5 or lat


From: Eduardo Habkost
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Require Python 3.5 or later
Date: Wed, 18 Sep 2019 22:15:36 -0300

On Wed, Sep 18, 2019 at 02:49:25PM -0400, John Snow wrote:
> On 9/18/19 4:55 AM, Kevin Wolf wrote:
> > Running iotests is not required to build QEMU, so we can have stricter
> > version requirements for Python here and can make use of new features
> > and drop compatibility code earlier.
> > 
> > This makes qemu-iotests skip all Python tests if a Python version before
> > 3.5 is used for the build.
> > 
> > Suggested-by: Eduardo Habkost <address@hidden>
> > Signed-off-by: Kevin Wolf <address@hidden>
> > ---
> >   tests/qemu-iotests/check | 14 +++++++++++++-
> >   1 file changed, 13 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> > index 875399d79f..a68f414d6c 100755
> > --- a/tests/qemu-iotests/check
> > +++ b/tests/qemu-iotests/check
> > @@ -633,6 +633,13 @@ then
> >       export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
> >   fi
> > +# Note that if the Python conditional here evaluates True we will exit
> > +# with status 1 which is a shell 'false' value.
> > +python_usable=false
> > +if ! $PYTHON -c 'import sys; sys.exit(sys.version_info >= (3,5))'; then
> > +    python_usable=true
> > +fi
> > +
> 
> Do we want this as a temporary fix only until we can stipulate the same
> version in the configure file?
> 
> If so, leaving a comment with "python2" in it anywhere will help locate this
> later.

There are other sys.version_info checks in the tree, so we'll
surely grep for them once we remove python2 support:

scripts/decodetree.py:if sys.version_info >= (3, 4):
scripts/qapi/common.py:            if sys.version_info[0] >= 3:
scripts/qapi/common.py:        if sys.version_info[0] >= 3:
scripts/qapi/common.py:        if sys.version_info[0] >= 3:
scripts/qmp/qmp-shell:if sys.version_info[0] == 2:
tests/qemu-iotests/044:if sys.version_info.major == 2:
tests/qemu-iotests/163:if sys.version_info.major == 2:
tests/qemu-iotests/iotests.py:    if sys.version_info.major >= 3:
tests/qemu-iotests/iotests.py:        if sys.version_info.major >= 3:
tests/qemu-iotests/nbd-fault-injector.py:if sys.version_info.major >= 3:

-- 
Eduardo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]