diff mbox series

[7/7] configure: Bump the minimum required Python version to 3.6

Message ID 20200921174320.46062-8-thuth@redhat.com
State New
Headers show
Series Do not support Debian 9 and Python 3.5 anymore | expand

Commit Message

Thomas Huth Sept. 21, 2020, 5:43 p.m. UTC
All our supported build platforms have Python 3.6 or newer nowadays,
and there are some useful features in Python 3.6 which are not available
in 3.5 yet, so let's bump the minimum Python version to 3.6 now.

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

Comments

John Snow Sept. 21, 2020, 6:04 p.m. UTC | #1
On 9/21/20 1:43 PM, Thomas Huth wrote:
> All our supported build platforms have Python 3.6 or newer nowadays,
> and there are some useful features in Python 3.6 which are not available
> in 3.5 yet, so let's bump the minimum Python version to 3.6 now.
> 

Just to add in case anyone wonders: This isn't incrementalism for 
incrementalism's sake, but the type hint annotations added in Python 3.6 
allow us to statically type the QAPI parser.

We are already using (and enforcing) these annotations in iotests.py, 
and I believe adding this to QAPI will be of high value going forward.

> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   configure | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 7564479008..a3a643168e 100755
> --- a/configure
> +++ b/configure
> @@ -1965,8 +1965,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 < (3,5))'; then
> -  error_exit "Cannot use '$python', Python >= 3.5 is required." \
> +if ! $python -c 'import sys; sys.exit(sys.version_info < (3,6))'; then
> +  error_exit "Cannot use '$python', Python >= 3.6 is required." \
>         "Use --python=/path/to/python to specify a supported Python."
>   fi
>   
> 

Do we need to bump the minimum version in the Sphinx conf, too?

There's also a minimum version check in iotests.py that is now 
*possibly* redundant, but it does no harm.

Regardless, none of those things cause any harm:

Reviewed-by: John Snow <jsnow@redhat.com>
Daniel P. Berrangé Sept. 21, 2020, 6:09 p.m. UTC | #2
On Mon, Sep 21, 2020 at 07:43:20PM +0200, Thomas Huth wrote:
> All our supported build platforms have Python 3.6 or newer nowadays,
> and there are some useful features in Python 3.6 which are not available
> in 3.5 yet, so let's bump the minimum Python version to 3.6 now.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


Regards,
Daniel
Peter Maydell Sept. 22, 2020, 10:55 a.m. UTC | #3
On Mon, 21 Sep 2020 at 19:20, John Snow <jsnow@redhat.com> wrote:
>
> On 9/21/20 1:43 PM, Thomas Huth wrote:
> > All our supported build platforms have Python 3.6 or newer nowadays,
> > and there are some useful features in Python 3.6 which are not available
> > in 3.5 yet, so let's bump the minimum Python version to 3.6 now.
> >
>
> Just to add in case anyone wonders: This isn't incrementalism for
> incrementalism's sake, but the type hint annotations added in Python 3.6
> allow us to statically type the QAPI parser.
>
> We are already using (and enforcing) these annotations in iotests.py,
> and I believe adding this to QAPI will be of high value going forward.
>
> > Signed-off-by: Thomas Huth <thuth@redhat.com>
> > ---
> >   configure | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 7564479008..a3a643168e 100755
> > --- a/configure
> > +++ b/configure
> > @@ -1965,8 +1965,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 < (3,5))'; then
> > -  error_exit "Cannot use '$python', Python >= 3.5 is required." \
> > +if ! $python -c 'import sys; sys.exit(sys.version_info < (3,6))'; then
> > +  error_exit "Cannot use '$python', Python >= 3.6 is required." \
> >         "Use --python=/path/to/python to specify a supported Python."
> >   fi
> >
> >
>
> Do we need to bump the minimum version in the Sphinx conf, too?

Yes -- the configure check only applies to python invoked
directly, not to python code invoked via Sphinx, so we
should keep both in sync.

thanks
-- PMM
Markus Armbruster Sept. 22, 2020, 2:15 p.m. UTC | #4
John Snow <jsnow@redhat.com> writes:

> On 9/21/20 1:43 PM, Thomas Huth wrote:

>> All our supported build platforms have Python 3.6 or newer nowadays,

>> and there are some useful features in Python 3.6 which are not available

>> in 3.5 yet, so let's bump the minimum Python version to 3.6 now.

>> 

>

> Just to add in case anyone wonders: This isn't incrementalism for

> incrementalism's sake, but the type hint annotations added in Python

> 3.6 allow us to statically type the QAPI parser.

>

> We are already using (and enforcing) these annotations in iotests.py,

> and I believe adding this to QAPI will be of high value going forward.


Concur.

[...]
diff mbox series

Patch

diff --git a/configure b/configure
index 7564479008..a3a643168e 100755
--- a/configure
+++ b/configure
@@ -1965,8 +1965,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 < (3,5))'; then
-  error_exit "Cannot use '$python', Python >= 3.5 is required." \
+if ! $python -c 'import sys; sys.exit(sys.version_info < (3,6))'; then
+  error_exit "Cannot use '$python', Python >= 3.6 is required." \
       "Use --python=/path/to/python to specify a supported Python."
 fi