* [Qemu-devel] [PATCH] configure: Require python3 >= 3.5
@ 2019-05-08 18:23 Eduardo Habkost
2019-05-09 5:40 ` Thomas Huth
2019-05-09 5:45 ` Markus Armbruster
0 siblings, 2 replies; 6+ messages in thread
From: Eduardo Habkost @ 2019-05-08 18:23 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Peter Maydell, Thomas Huth, Markus Armbruster,
Cleber Rosa, Philippe Mathieu-Daudé
The oldest python3 version in distros that will be supported by
QEMU 4.1 is 3.5.3 (the one in Debian Stretch). Error out if
running python3 < 3.5.
We have a .travis.yml job configured to use Python 3.4. Change
it to use Python 3.5.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
configure | 5 +++--
.travis.yml | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index 6b3ed8c532..520c207d66 100755
--- a/configure
+++ b/configure
@@ -1841,8 +1841,9 @@ fi
# Note that if the Python conditional here evaluates True we will exit
# with status 1 which is a shell 'false' value.
-if ! $python -c 'import sys; sys.exit(sys.version_info < (2,7))'; then
- error_exit "Cannot use '$python', Python 2 >= 2.7 or Python 3 is required." \
+if ! $python -c 'import sys; sys.exit(sys.version_info < (2,7) or \
+ (3,0) <= sys.version_info < (3,5))'; then
+ error_exit "Cannot use '$python', Python 2 >= 2.7 or Python 3 >= 3.5 is required." \
"Use --python=/path/to/python to specify a supported Python."
fi
diff --git a/.travis.yml b/.travis.yml
index 66448d99d6..0f6986b3f1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -211,7 +211,7 @@ matrix:
- CONFIG="--target-list=x86_64-softmmu"
language: python
python:
- - "3.4"
+ - "3.5"
- env:
--
2.18.0.rc1.1.g3f1ff2140
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: Require python3 >= 3.5
2019-05-08 18:23 [Qemu-devel] [PATCH] configure: Require python3 >= 3.5 Eduardo Habkost
@ 2019-05-09 5:40 ` Thomas Huth
2019-05-09 5:45 ` Markus Armbruster
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2019-05-09 5:40 UTC (permalink / raw)
To: Eduardo Habkost, qemu-devel
Cc: Kevin Wolf, Peter Maydell, Markus Armbruster, Cleber Rosa,
Philippe Mathieu-Daudé
On 08/05/2019 20.23, Eduardo Habkost wrote:
> The oldest python3 version in distros that will be supported by
> QEMU 4.1 is 3.5.3 (the one in Debian Stretch). Error out if
> running python3 < 3.5.
>
> We have a .travis.yml job configured to use Python 3.4. Change
> it to use Python 3.5.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> configure | 5 +++--
> .travis.yml | 2 +-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 6b3ed8c532..520c207d66 100755
> --- a/configure
> +++ b/configure
> @@ -1841,8 +1841,9 @@ fi
>
> # Note that if the Python conditional here evaluates True we will exit
> # with status 1 which is a shell 'false' value.
> -if ! $python -c 'import sys; sys.exit(sys.version_info < (2,7))'; then
> - error_exit "Cannot use '$python', Python 2 >= 2.7 or Python 3 is required." \
> +if ! $python -c 'import sys; sys.exit(sys.version_info < (2,7) or \
> + (3,0) <= sys.version_info < (3,5))'; then
> + error_exit "Cannot use '$python', Python 2 >= 2.7 or Python 3 >= 3.5 is required." \
Nit: There won't be a Python2 > 2.7 anymore, so you could also replace
"2 >= 2.7" with "2.7" here. But well, it will go away next year anyway, so:
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: Require python3 >= 3.5
2019-05-08 18:23 [Qemu-devel] [PATCH] configure: Require python3 >= 3.5 Eduardo Habkost
2019-05-09 5:40 ` Thomas Huth
@ 2019-05-09 5:45 ` Markus Armbruster
2019-05-09 9:24 ` Kevin Wolf
1 sibling, 1 reply; 6+ messages in thread
From: Markus Armbruster @ 2019-05-09 5:45 UTC (permalink / raw)
To: Eduardo Habkost
Cc: Kevin Wolf, Peter Maydell, Thomas Huth, qemu-devel,
Stefan Hajnoczi, Cleber Rosa, Philippe Mathieu-Daudé
Eduardo Habkost <ehabkost@redhat.com> writes:
> The oldest python3 version in distros that will be supported by
> QEMU 4.1 is 3.5.3 (the one in Debian Stretch). Error out if
> running python3 < 3.5.
>
> We have a .travis.yml job configured to use Python 3.4. Change
> it to use Python 3.5.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> configure | 5 +++--
> .travis.yml | 2 +-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 6b3ed8c532..520c207d66 100755
> --- a/configure
> +++ b/configure
> @@ -1841,8 +1841,9 @@ fi
>
> # Note that if the Python conditional here evaluates True we will exit
> # with status 1 which is a shell 'false' value.
> -if ! $python -c 'import sys; sys.exit(sys.version_info < (2,7))'; then
> - error_exit "Cannot use '$python', Python 2 >= 2.7 or Python 3 is required." \
> +if ! $python -c 'import sys; sys.exit(sys.version_info < (2,7) or \
> + (3,0) <= sys.version_info < (3,5))'; then
> + error_exit "Cannot use '$python', Python 2 >= 2.7 or Python 3 >= 3.5 is required." \
> "Use --python=/path/to/python to specify a supported Python."
> fi
>
> diff --git a/.travis.yml b/.travis.yml
> index 66448d99d6..0f6986b3f1 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -211,7 +211,7 @@ matrix:
> - CONFIG="--target-list=x86_64-softmmu"
> language: python
> python:
> - - "3.4"
> + - "3.5"
>
>
> - env:
Easily missed, good work.
My grep for similar references to Python versions we don't support found
a few 2.x, x < 7. Not this patch's problem, of course, but let me show
them anyway:
* scripts/qapi/common.py
# re.subn() lacks flags support before Python 2.7, use re.compile()
I'll clean this up.
* tests/image-fuzzer/
docs/image-fuzzer.txt "Fuzzer requirements" item "17. Should be
compatible with python version 2.4-2.7".
Stefan, does the fuzzer need porting to Python 3?
Two spots in the code are marked as 2.4 work-arounds:
tests/image-fuzzer/qcow2/fuzz.py: in Python 2.4
tests/image-fuzzer/runner.py: # Python 2.4 doesn't support 'finally' and 'except' in the same 'try'
Grep also found tests/vm/netbsd and tests/vm/openbsd pass
--python=python2.7 to configure. Eduardo, should they be upgraded to a
suitable version of Python 3? Possibly in your "[PATCH] Deprecate
Python 2 support"?
If yes, then https://wiki.qemu.org/Hosts/BSD also needs an update.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: Require python3 >= 3.5
2019-05-09 5:45 ` Markus Armbruster
@ 2019-05-09 9:24 ` Kevin Wolf
2019-05-09 9:36 ` Kevin Wolf
0 siblings, 1 reply; 6+ messages in thread
From: Kevin Wolf @ 2019-05-09 9:24 UTC (permalink / raw)
To: Markus Armbruster
Cc: Peter Maydell, Thomas Huth, Eduardo Habkost, qemu-devel,
Stefan Hajnoczi, Cleber Rosa, Philippe Mathieu-Daudé
Am 09.05.2019 um 07:45 hat Markus Armbruster geschrieben:
> Eduardo Habkost <ehabkost@redhat.com> writes:
> > diff --git a/.travis.yml b/.travis.yml
> > index 66448d99d6..0f6986b3f1 100644
> > --- a/.travis.yml
> > +++ b/.travis.yml
> > @@ -211,7 +211,7 @@ matrix:
> > - CONFIG="--target-list=x86_64-softmmu"
> > language: python
> > python:
> > - - "3.4"
> > + - "3.5"
> >
> >
> > - env:
>
> Easily missed, good work.
>
> My grep for similar references to Python versions we don't support found
> a few 2.x, x < 7. Not this patch's problem, of course, but let me show
> them anyway:
I'm sure that we have a few more instances of Python 2 compatibility
code in qemu-iotests that can be removed after this is merged. These are
what I could find quickly, but there are probably more:
242: # Read one byte in a way compatible with Python 2
iotests.py: # Python < 3.4 needs to know not to add whitespace when pretty-printing:
149:from __future__ import print_function
165:from __future__ import print_function
iotests.py:from __future__ import print_function
nbd-fault-injector.py:from __future__ import print_function
qcow2.py:from __future__ import print_function
qed.py:from __future__ import print_function
044:if sys.version_info.major == 2:
163:if sys.version_info.major == 2:
iotests.py: if sys.version_info.major >= 3:
iotests.py: if sys.version_info.major >= 3:
nbd-fault-injector.py:if sys.version_info.major >= 3:
I'm planning to take care of the qemu-iotests ones.
Also, with Python 3.5 as the new minimum, I think I'd like to add type
hints to iotests.py and possibly the qemu package (for QEMUQtestMachine
and friends). The syntax isn't as nice as if we could go straight to
3.6, but still, finally some type checking instead of running into
stupid runtime bugs!
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: Require python3 >= 3.5
2019-05-09 9:24 ` Kevin Wolf
@ 2019-05-09 9:36 ` Kevin Wolf
2019-05-09 9:40 ` Daniel P. Berrangé
0 siblings, 1 reply; 6+ messages in thread
From: Kevin Wolf @ 2019-05-09 9:36 UTC (permalink / raw)
To: Markus Armbruster
Cc: Peter Maydell, Thomas Huth, Eduardo Habkost, qemu-devel,
Stefan Hajnoczi, Cleber Rosa, Philippe Mathieu-Daudé
Am 09.05.2019 um 11:24 hat Kevin Wolf geschrieben:
> Am 09.05.2019 um 07:45 hat Markus Armbruster geschrieben:
> > Eduardo Habkost <ehabkost@redhat.com> writes:
> > > diff --git a/.travis.yml b/.travis.yml
> > > index 66448d99d6..0f6986b3f1 100644
> > > --- a/.travis.yml
> > > +++ b/.travis.yml
> > > @@ -211,7 +211,7 @@ matrix:
> > > - CONFIG="--target-list=x86_64-softmmu"
> > > language: python
> > > python:
> > > - - "3.4"
> > > + - "3.5"
> > >
> > >
> > > - env:
> >
> > Easily missed, good work.
> >
> > My grep for similar references to Python versions we don't support found
> > a few 2.x, x < 7. Not this patch's problem, of course, but let me show
> > them anyway:
>
> I'm sure that we have a few more instances of Python 2 compatibility
> code in qemu-iotests that can be removed after this is merged. These are
> what I could find quickly, but there are probably more:
>
> 242: # Read one byte in a way compatible with Python 2
> iotests.py: # Python < 3.4 needs to know not to add whitespace when pretty-printing:
>
> 149:from __future__ import print_function
> 165:from __future__ import print_function
> iotests.py:from __future__ import print_function
> nbd-fault-injector.py:from __future__ import print_function
> qcow2.py:from __future__ import print_function
> qed.py:from __future__ import print_function
>
> 044:if sys.version_info.major == 2:
> 163:if sys.version_info.major == 2:
> iotests.py: if sys.version_info.major >= 3:
> iotests.py: if sys.version_info.major >= 3:
> nbd-fault-injector.py:if sys.version_info.major >= 3:
>
> I'm planning to take care of the qemu-iotests ones.
>
> Also, with Python 3.5 as the new minimum, I think I'd like to add type
> hints to iotests.py and possibly the qemu package (for QEMUQtestMachine
> and friends). The syntax isn't as nice as if we could go straight to
> 3.6, but still, finally some type checking instead of running into
> stupid runtime bugs!
Ah, sorry, I was getting too excited there. We only deprecate 2.x now
(and not even in this patch), but don't remove it yet. So I guess this
will have to wait until next year.
Kevin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH] configure: Require python3 >= 3.5
2019-05-09 9:36 ` Kevin Wolf
@ 2019-05-09 9:40 ` Daniel P. Berrangé
0 siblings, 0 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2019-05-09 9:40 UTC (permalink / raw)
To: Kevin Wolf
Cc: Peter Maydell, Thomas Huth, Eduardo Habkost, qemu-devel,
Markus Armbruster, Stefan Hajnoczi, Cleber Rosa,
Philippe Mathieu-Daudé
On Thu, May 09, 2019 at 11:36:04AM +0200, Kevin Wolf wrote:
> Am 09.05.2019 um 11:24 hat Kevin Wolf geschrieben:
> > Am 09.05.2019 um 07:45 hat Markus Armbruster geschrieben:
> > > Eduardo Habkost <ehabkost@redhat.com> writes:
> > > > diff --git a/.travis.yml b/.travis.yml
> > > > index 66448d99d6..0f6986b3f1 100644
> > > > --- a/.travis.yml
> > > > +++ b/.travis.yml
> > > > @@ -211,7 +211,7 @@ matrix:
> > > > - CONFIG="--target-list=x86_64-softmmu"
> > > > language: python
> > > > python:
> > > > - - "3.4"
> > > > + - "3.5"
> > > >
> > > >
> > > > - env:
> > >
> > > Easily missed, good work.
> > >
> > > My grep for similar references to Python versions we don't support found
> > > a few 2.x, x < 7. Not this patch's problem, of course, but let me show
> > > them anyway:
> >
> > I'm sure that we have a few more instances of Python 2 compatibility
> > code in qemu-iotests that can be removed after this is merged. These are
> > what I could find quickly, but there are probably more:
> >
> > 242: # Read one byte in a way compatible with Python 2
> > iotests.py: # Python < 3.4 needs to know not to add whitespace when pretty-printing:
> >
> > 149:from __future__ import print_function
> > 165:from __future__ import print_function
> > iotests.py:from __future__ import print_function
> > nbd-fault-injector.py:from __future__ import print_function
> > qcow2.py:from __future__ import print_function
> > qed.py:from __future__ import print_function
> >
> > 044:if sys.version_info.major == 2:
> > 163:if sys.version_info.major == 2:
> > iotests.py: if sys.version_info.major >= 3:
> > iotests.py: if sys.version_info.major >= 3:
> > nbd-fault-injector.py:if sys.version_info.major >= 3:
> >
> > I'm planning to take care of the qemu-iotests ones.
> >
> > Also, with Python 3.5 as the new minimum, I think I'd like to add type
> > hints to iotests.py and possibly the qemu package (for QEMUQtestMachine
> > and friends). The syntax isn't as nice as if we could go straight to
> > 3.6, but still, finally some type checking instead of running into
> > stupid runtime bugs!
>
> Ah, sorry, I was getting too excited there. We only deprecate 2.x now
> (and not even in this patch), but don't remove it yet. So I guess this
> will have to wait until next year.
If you're happy using one of the comment based hinting syntax, that
will work, or at least not break, with python 2
https://www.bernat.tech/the-state-of-type-hints-in-python/
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-05-09 9:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-08 18:23 [Qemu-devel] [PATCH] configure: Require python3 >= 3.5 Eduardo Habkost
2019-05-09 5:40 ` Thomas Huth
2019-05-09 5:45 ` Markus Armbruster
2019-05-09 9:24 ` Kevin Wolf
2019-05-09 9:36 ` Kevin Wolf
2019-05-09 9:40 ` Daniel P. Berrangé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).