Kara-Moon Forum

Developers & Technology => Musical MIDI Accompaniment (MMA) => Topic started by: bvdp on October 09, 2019, 02:55:36 AM



Title: End python 2.x support?
Post by: bvdp on October 09, 2019, 02:55:36 AM
There will be one more python 2.x release, probably this year or early 2020. I'm thinking we should remove 2.x support for MMA ... comments would be appreciated. My suggestion at this time is to support it in the 2020 tree and then remove all conditionals, etc. in the 2021 release. On the other hand, it's probably not a big deal to continue to support 2.x "forever" :)


Title: Re: End python 2.x support?
Post by: folderol on October 09, 2019, 04:26:21 PM
Well, for what it's worth even debian installs 3 by default these days :)


Title: Re: End python 2.x support?
Post by: bvdp on October 10, 2019, 02:05:13 AM
Well, for what it's worth even debian installs 3 by default these days :)

Yes, but is the link in /usr/bin/python pointing at 3.x or 2.x? I know my Ubuntu distro is a symlink to python2.7.


Title: Re: End python 2.x support?
Post by: folderol on October 10, 2019, 03:12:51 PM
Well, for what it's worth even debian installs 3 by default these days :)

Yes, but is the link in /usr/bin/python pointing at 3.x or 2.x? I know my Ubuntu distro is a symlink to python2.7.
Good question...
and an 'interesting' answer! On one machine it's 2.7 and another it's 3.5.

The 2.7 one has been progressively upgraded (like most on mine). The 3.5 one was a completely new machine and install.
The upshot is that I think you will have to carry on supporting the older version for some time yet :(


Title: Re: End python 2.x support?
Post by: bvdp on October 10, 2019, 04:06:15 PM
Yeah, I was suggesting the end of next year. Maybe that is too quick? We'll have to see.


Title: Re: End python 2.x support?
Post by: sciurius on October 11, 2019, 08:15:12 AM
Building the mma kit on Fedora yields a lot of warnings about the shebang lines. The current practice of using

    #!/usr/bin/env python

is considered 'bad' and will be flagged as error in the near future.

So I'm going to change the shebangs to

    #!/usr/bin/python3

As for the support for python2 in the source code: I'd suggest a warning issued by the main program similar to

    You are running MMA under Python2. This is obsolete and some features may no longer work as expected.
    Please upgrade to Python3.


Explicitly traversing all sources and removing python2/3 conditionals may be harmfull... Do not change sources that do not need changing :) .


Title: Re: End python 2.x support?
Post by: bvdp on October 11, 2019, 04:20:07 PM
Since, in most linux distros, /usr/bin/python is a link to either python2 or python3 is it easier to change the line to

   #!/usr/bin/python

And let the distro sort out its preference? There was a long thread about the use of env awhile ago on the python mail list and I think the result was inconclusive. But, I do clearly remember that when I started this project the use of env was considered a wonderful thing :)

I like the idea of the python warning message. Fortunately, there is no rush on this (famous last words!).


Title: Re: End python 2.x support?
Post by: bvdp on October 11, 2019, 05:23:35 PM
I just read this and _think_ I understand it :) I gather that the Fedora folk think that using:

   #!/usr/bin/python

is good. /usr/bin/python is currently a link to python2 and will, eventually, be changed to /usr/bin/python3. Can anyone confirm this? If so, I'd suggest we change to #!/usr/bin/python.

Fedora installs both 2 and 3 as do many other distros.

It's probably easy enough to change to python3 if the user really wants that. On my system I have 2 scripts: mma (the env default) and mma3 (which uses python3).


Title: Re: End python 2.x support?
Post by: sciurius on October 11, 2019, 06:36:34 PM
The reason I wanted to change the shebang to python3 is to be able to get rid of python2 compatibility. MMA runs fine under python3, so let's use it.
When using just /usr/bin/python it depends on when the system vendor and/or administrator makes the change.

But I agree, no hurry.


Title: Re: End python 2.x support?
Post by: bvdp on October 11, 2019, 06:55:27 PM
The reason I wanted to change the shebang to python3 is to be able to get rid of python2 compatibility. MMA runs fine under python3, so let's use it.
When using just /usr/bin/python it depends on when the system vendor and/or administrator makes the change.

But I agree, no hurry.

Yes, but if we ship with python3 and the user has an older system he/she is screwed. Mine you, if the system is that old they will have lots of other problems :) I really think the first release in 2011 will be the one. And, in the meantime I will take out the 'env'.