[Qemu-devel] [PATCH] configure: Require Python 2.7 or newer

Eduardo Habkost posted 1 patch 5 years, 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180608143026.20167-1-ehabkost@redhat.com
Test checkpatch passed
Test docker-mingw@fedora passed
Test docker-quick@centos7 passed
Test s390x passed
configure | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Eduardo Habkost 5 years, 10 months ago
All of the supported build platforms documented in qemu-doc.texi
should already support Python 2.7.

Removing support for Python 2.6 will allow us to remove some
compatibility modules we carry in the QEMU tree:

* scripts/argparse.py
* scripts/ordereddict.py

Python 2.6 is also not receiving bug fixes upstream and is not
supported by pylint, which makes it harder to keep the code
compatible with both Python 2 and Python 3.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 14b11130a7..a8c4094c87 100755
--- a/configure
+++ b/configure
@@ -1651,8 +1651,8 @@ 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,6))'; then
-  error_exit "Cannot use '$python', Python 2 >= 2.6 or Python 3 is required." \
+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." \
       "Use --python=/path/to/python to specify a supported Python."
 fi
 
-- 
2.18.0.rc1.1.g3f1ff2140


Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Philippe Mathieu-Daudé 5 years, 10 months ago
Cc'ing Eric

On 06/08/2018 11:30 AM, Eduardo Habkost wrote:
> All of the supported build platforms documented in qemu-doc.texi
> should already support Python 2.7.

https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg05173.html

  On 08/25/2017 11:40 AM, Peter Maydell wrote:
  > Our choices about our dependencies are generally driven by "what
  > are the versions available on the oldest distros which we wish
  > to support building QEMU on", which typically is whatever the
  > long-term-support versions of Ubuntu, SUSE, Redhat, etc are.
  >
  > Has somebody checked what that means for our Python version
  > requirements?

  At least this one:

  RHEL/CentOS 6: Python-2.6.6

> 
> Removing support for Python 2.6 will allow us to remove some
> compatibility modules we carry in the QEMU tree:
> 
> * scripts/argparse.py
> * scripts/ordereddict.py
> 
> Python 2.6 is also not receiving bug fixes upstream and is not
> supported by pylint, which makes it harder to keep the code
> compatible with both Python 2 and Python 3.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 14b11130a7..a8c4094c87 100755
> --- a/configure
> +++ b/configure
> @@ -1651,8 +1651,8 @@ 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,6))'; then
> -  error_exit "Cannot use '$python', Python 2 >= 2.6 or Python 3 is required." \
> +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." \
>        "Use --python=/path/to/python to specify a supported Python."
>  fi
>  
> 

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Daniel P. Berrangé 5 years, 10 months ago
On Fri, Jun 08, 2018 at 11:37:36AM -0300, Philippe Mathieu-Daudé wrote:
> Cc'ing Eric
> 
> On 06/08/2018 11:30 AM, Eduardo Habkost wrote:
> > All of the supported build platforms documented in qemu-doc.texi
> > should already support Python 2.7.
> 
> https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg05173.html
> 
>   On 08/25/2017 11:40 AM, Peter Maydell wrote:
>   > Our choices about our dependencies are generally driven by "what
>   > are the versions available on the oldest distros which we wish
>   > to support building QEMU on", which typically is whatever the
>   > long-term-support versions of Ubuntu, SUSE, Redhat, etc are.
>   >
>   > Has somebody checked what that means for our Python version
>   > requirements?
> 
>   At least this one:
> 
>   RHEL/CentOS 6: Python-2.6.6

RHEL6 is no longer a target we care about and is being explicitly
broken as a result of the min glib bump:

  https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg02104.html

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 :|

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Philippe Mathieu-Daudé 5 years, 10 months ago
On 06/08/2018 11:40 AM, Daniel P. Berrangé wrote:
> On Fri, Jun 08, 2018 at 11:37:36AM -0300, Philippe Mathieu-Daudé wrote:
>> Cc'ing Eric
>>
>> On 06/08/2018 11:30 AM, Eduardo Habkost wrote:
>>> All of the supported build platforms documented in qemu-doc.texi
>>> should already support Python 2.7.
>>
>> https://lists.gnu.org/archive/html/qemu-devel/2017-08/msg05173.html
>>
>>   On 08/25/2017 11:40 AM, Peter Maydell wrote:
>>   > Our choices about our dependencies are generally driven by "what
>>   > are the versions available on the oldest distros which we wish
>>   > to support building QEMU on", which typically is whatever the
>>   > long-term-support versions of Ubuntu, SUSE, Redhat, etc are.
>>   >
>>   > Has somebody checked what that means for our Python version
>>   > requirements?
>>
>>   At least this one:
>>
>>   RHEL/CentOS 6: Python-2.6.6
> 
> RHEL6 is no longer a target we care about and is being explicitly
> broken as a result of the min glib bump:
> 
>   https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg02104.html

\o/

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Daniel P. Berrangé 5 years, 10 months ago
On Fri, Jun 08, 2018 at 11:30:26AM -0300, Eduardo Habkost wrote:
> All of the supported build platforms documented in qemu-doc.texi
> should already support Python 2.7.
> 
> Removing support for Python 2.6 will allow us to remove some
> compatibility modules we carry in the QEMU tree:
> 
> * scripts/argparse.py
> * scripts/ordereddict.py

Lets delete those in this patch then....

> 
> Python 2.6 is also not receiving bug fixes upstream and is not
> supported by pylint, which makes it harder to keep the code
> compatible with both Python 2 and Python 3.

Agreed, there's no compelling reason for 2.6 to stay around

> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 14b11130a7..a8c4094c87 100755
> --- a/configure
> +++ b/configure
> @@ -1651,8 +1651,8 @@ 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,6))'; then
> -  error_exit "Cannot use '$python', Python 2 >= 2.6 or Python 3 is required." \
> +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." \
>        "Use --python=/path/to/python to specify a supported Python."
>  fi
>  
> -- 
> 2.18.0.rc1.1.g3f1ff2140
> 

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 :|

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Eduardo Habkost 5 years, 10 months ago
On Fri, Jun 08, 2018 at 03:37:47PM +0100, Daniel P. Berrangé wrote:
> On Fri, Jun 08, 2018 at 11:30:26AM -0300, Eduardo Habkost wrote:
> > All of the supported build platforms documented in qemu-doc.texi
> > should already support Python 2.7.
> > 
> > Removing support for Python 2.6 will allow us to remove some
> > compatibility modules we carry in the QEMU tree:
> > 
> > * scripts/argparse.py
> > * scripts/ordereddict.py
> 
> Lets delete those in this patch then....

I will do it, but I prefer to do this in a separate patch.

-- 
Eduardo

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Daniel P. Berrangé 5 years, 10 months ago
On Fri, Jun 08, 2018 at 11:55:59AM -0300, Eduardo Habkost wrote:
> On Fri, Jun 08, 2018 at 03:37:47PM +0100, Daniel P. Berrangé wrote:
> > On Fri, Jun 08, 2018 at 11:30:26AM -0300, Eduardo Habkost wrote:
> > > All of the supported build platforms documented in qemu-doc.texi
> > > should already support Python 2.7.
> > > 
> > > Removing support for Python 2.6 will allow us to remove some
> > > compatibility modules we carry in the QEMU tree:
> > > 
> > > * scripts/argparse.py
> > > * scripts/ordereddict.py
> > 
> > Lets delete those in this patch then....
> 
> I will do it, but I prefer to do this in a separate patch.

Ok that's fine


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 :|

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Eduardo Habkost 5 years, 10 months ago
On Fri, Jun 08, 2018 at 11:30:26AM -0300, Eduardo Habkost wrote:
> All of the supported build platforms documented in qemu-doc.texi
> should already support Python 2.7.
> 
> Removing support for Python 2.6 will allow us to remove some
> compatibility modules we carry in the QEMU tree:
> 
> * scripts/argparse.py
> * scripts/ordereddict.py
> 
> Python 2.6 is also not receiving bug fixes upstream and is not
> supported by pylint, which makes it harder to keep the code
> compatible with both Python 2 and Python 3.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

For reference, this is has info on the Python 2 version on many
popular software repositories:

https://repology.org/metapackage/python2/versions

I did this to check for repositories that don't have any 2.7 package:

  $ curl -s 'https://repology.org/api/v1/metapackage/python2' | \
    jq -r 'group_by(.repo) | .[] | "\(.[0].repo): \(map(.version))"' | \
    grep -v '"2\.7'
  centos_6: ["2.6.6"]
  maemo_fremantle: ["2.5.4","2.5.4","2.5.4","2.5.4"]
  rosa_server_6_9: ["2.6.6"]

-- 
Eduardo

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Daniel P. Berrangé 5 years, 10 months ago
On Fri, Jun 08, 2018 at 11:30:26AM -0300, Eduardo Habkost wrote:
> All of the supported build platforms documented in qemu-doc.texi
> should already support Python 2.7.
> 
> Removing support for Python 2.6 will allow us to remove some
> compatibility modules we carry in the QEMU tree:
> 
> * scripts/argparse.py
> * scripts/ordereddict.py
> 
> Python 2.6 is also not receiving bug fixes upstream and is not
> supported by pylint, which makes it harder to keep the code
> compatible with both Python 2 and Python 3.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


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 :|

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Cleber Rosa 5 years, 10 months ago

On 06/08/2018 10:30 AM, Eduardo Habkost wrote:
> All of the supported build platforms documented in qemu-doc.texi
> should already support Python 2.7.
> 
> Removing support for Python 2.6 will allow us to remove some
> compatibility modules we carry in the QEMU tree:
> 
> * scripts/argparse.py
> * scripts/ordereddict.py
> 
> Python 2.6 is also not receiving bug fixes upstream and is not
> supported by pylint, which makes it harder to keep the code
> compatible with both Python 2 and Python 3.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 14b11130a7..a8c4094c87 100755
> --- a/configure
> +++ b/configure
> @@ -1651,8 +1651,8 @@ 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,6))'; then
> -  error_exit "Cannot use '$python', Python 2 >= 2.6 or Python 3 is required." \
> +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." \
>        "Use --python=/path/to/python to specify a supported Python."
>  fi
>  
> 

This is a memorable milestone for the Python code.

Reviewed-by: Cleber Rosa <crosa@redhat.com>


Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by John Snow 5 years, 10 months ago

On 06/08/2018 10:30 AM, Eduardo Habkost wrote:
> All of the supported build platforms documented in qemu-doc.texi
> should already support Python 2.7.
> 
> Removing support for Python 2.6 will allow us to remove some
> compatibility modules we carry in the QEMU tree:
> 
> * scripts/argparse.py
> * scripts/ordereddict.py
> 
> Python 2.6 is also not receiving bug fixes upstream and is not
> supported by pylint, which makes it harder to keep the code
> compatible with both Python 2 and Python 3.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 14b11130a7..a8c4094c87 100755
> --- a/configure
> +++ b/configure
> @@ -1651,8 +1651,8 @@ 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,6))'; then
> -  error_exit "Cannot use '$python', Python 2 >= 2.6 or Python 3 is required." \
> +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." \
>        "Use --python=/path/to/python to specify a supported Python."
>  fi
>  
> 

CHEERS.

Reviewed-by: John Snow <jsnow@redhat.com>

Re: [Qemu-devel] [PATCH] configure: Require Python 2.7 or newer
Posted by Stefan Hajnoczi 5 years, 10 months ago
On Fri, Jun 08, 2018 at 11:30:26AM -0300, Eduardo Habkost wrote:
> All of the supported build platforms documented in qemu-doc.texi
> should already support Python 2.7.
> 
> Removing support for Python 2.6 will allow us to remove some
> compatibility modules we carry in the QEMU tree:
> 
> * scripts/argparse.py
> * scripts/ordereddict.py
> 
> Python 2.6 is also not receiving bug fixes upstream and is not
> supported by pylint, which makes it harder to keep the code
> compatible with both Python 2 and Python 3.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>