[libvirt-python PATCH] setup: require python >= 3.5 to build

Daniel P. Berrangé posted 1 patch 4 years ago
Failed in applying to current master (apply log)
There is a newer version of this series
setup.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[libvirt-python PATCH] setup: require python >= 3.5 to build
Posted by Daniel P. Berrangé 4 years ago
Pytjon 3.5 is the oldest Python version available across our supported
build platforms.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 setup.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 56b6eea..b3e418e 100755
--- a/setup.py
+++ b/setup.py
@@ -17,8 +17,8 @@ import re
 import shutil
 import time
 
-if sys.version_info[0] != 3:
-    print("libvirt-python requires Python 3.x to build")
+if sys.version_info[0] != 3 or sys.version_info[1] < 5:
+    print("libvirt-python requires Python 3 >= 3.5 to build")
     sys.exit(1)
 
 MIN_LIBVIRT = "0.9.11"
-- 
2.25.2

Re: [libvirt-python PATCH] setup: require python >= 3.5 to build
Posted by Philipp Hahn 4 years ago
Hello Daniel.

2 nits:

Am 20.04.20 um 14:47 schrieb Daniel P. Berrangé:
> Pytjon 3.5 is the oldest Python version available across our supported
     ^ h
> build platforms.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  setup.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/setup.py b/setup.py
> index 56b6eea..b3e418e 100755
> --- a/setup.py
> +++ b/setup.py
> @@ -17,8 +17,8 @@ import re
>  import shutil
>  import time
>  
> -if sys.version_info[0] != 3:
> -    print("libvirt-python requires Python 3.x to build")
> +if sys.version_info[0] != 3 or sys.version_info[1] < 5:

if sys.version_info < (3, 5):

> +    print("libvirt-python requires Python 3 >= 3.5 to build")
>      sys.exit(1)
>  
>  MIN_LIBVIRT = "0.9.11"
> 

plus maybe this:

> diff --git a/setup.py b/setup.py
> index 56b6eea..e20b7b3 100755
> --- a/setup.py
> +++ b/setup.py
> @@ -368,5 +368,9 @@ of recent versions of Linux (and other OSes).''',
>            "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
>            "Programming Language :: Python",
>            "Programming Language :: Python :: 3",
> +          "Programming Language :: Python :: 3.5",
> +          "Programming Language :: Python :: 3.6",
> +          "Programming Language :: Python :: 3.7",
> +          "Programming Language :: Python :: 3.8",
>        ]
>  )


Philipp


Re: [libvirt-python PATCH] setup: require python >= 3.5 to build
Posted by Daniel P. Berrangé 4 years ago
On Mon, Apr 20, 2020 at 02:59:38PM +0200, Philipp Hahn wrote:
> Hello Daniel.
> 
> 2 nits:
> 
> Am 20.04.20 um 14:47 schrieb Daniel P. Berrangé:
> > Pytjon 3.5 is the oldest Python version available across our supported
>      ^ h
> > build platforms.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >  setup.py | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/setup.py b/setup.py
> > index 56b6eea..b3e418e 100755
> > --- a/setup.py
> > +++ b/setup.py
> > @@ -17,8 +17,8 @@ import re
> >  import shutil
> >  import time
> >  
> > -if sys.version_info[0] != 3:
> > -    print("libvirt-python requires Python 3.x to build")
> > +if sys.version_info[0] != 3 or sys.version_info[1] < 5:
> 
> if sys.version_info < (3, 5):

IIUC, that would not reject  Python 4.x, which I presume would be
a backwards incompatible version bump.  

> 
> > +    print("libvirt-python requires Python 3 >= 3.5 to build")
> >      sys.exit(1)
> >  
> >  MIN_LIBVIRT = "0.9.11"
> > 
> 
> plus maybe this:
> 
> > diff --git a/setup.py b/setup.py
> > index 56b6eea..e20b7b3 100755
> > --- a/setup.py
> > +++ b/setup.py
> > @@ -368,5 +368,9 @@ of recent versions of Linux (and other OSes).''',
> >            "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
> >            "Programming Language :: Python",
> >            "Programming Language :: Python :: 3",
> > +          "Programming Language :: Python :: 3.5",
> > +          "Programming Language :: Python :: 3.6",
> > +          "Programming Language :: Python :: 3.7",
> > +          "Programming Language :: Python :: 3.8",

Are these used for any functional purpose, or just really a documentation
thing ?  This does introduce the issue of someone having to remember to
add  3.9, 3.10, etc as they arrive. I'm confident we'll forget that.


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: [libvirt-python PATCH] setup: require python >= 3.5 to build
Posted by Philipp Hahn 4 years ago
Hello Daniel,

Am 20.04.20 um 15:02 schrieb Daniel P. Berrangé:
> On Mon, Apr 20, 2020 at 02:59:38PM +0200, Philipp Hahn wrote:
>> Am 20.04.20 um 14:47 schrieb Daniel P. Berrangé:
>>> Pytjon 3.5 is the oldest Python version available across our supported
...
>>> -if sys.version_info[0] != 3:
>>> -    print("libvirt-python requires Python 3.x to build")
>>> +if sys.version_info[0] != 3 or sys.version_info[1] < 5:
>>
>> if sys.version_info < (3, 5):
> 
> IIUC, that would not reject  Python 4.x, which I presume would be
> a backwards incompatible version bump. 

Yes, that would not reject 4. But lets wait until Python 4 is started to
decide if we then want to disable libvirt for it - assume the best and
hope it will be (mostly) backward compatible. (many Python 2 program
even work with Python 3 and having to change each of them just to
while-list the version bump would be a pain.)

That would be the "Pythonic" way of doing things.

>> plus maybe this:
>>
>>> diff --git a/setup.py b/setup.py
>>> index 56b6eea..e20b7b3 100755
>>> --- a/setup.py
>>> +++ b/setup.py
>>> @@ -368,5 +368,9 @@ of recent versions of Linux (and other OSes).''',
>>>            "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
>>>            "Programming Language :: Python",
>>>            "Programming Language :: Python :: 3",
>>> +          "Programming Language :: Python :: 3.5",
>>> +          "Programming Language :: Python :: 3.6",
>>> +          "Programming Language :: Python :: 3.7",
>>> +          "Programming Language :: Python :: 3.8",
> 
> Are these used for any functional purpose, or just really a documentation
> thing ?  This does introduce the issue of someone having to remember to
> add  3.9, 3.10, etc as they arrive. I'm confident we'll forget that.

Those are the "Trove clasifiers" <https://pypi.org/classifiers/>, which
are for example displayed on PyPi
<https://pypi.org/project/libvirt-python/>. It helps to know that
someone tested it with those versions.

As there is not "does not work with 3.4 or older" I chose to explicitly
list the versions which we support currently (contradicting my words above).

Philipp