Kara-Moon Forum
March 28, 2024, 05:24:35 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can go back to the main site here: Kara-Moon site
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: End python 2.x support?  (Read 4398 times)
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« 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" Smiley
Logged

My online life: http://www.mellowood.ca
folderol
Kara-Moon Master
****
Posts: 5296

Who? Me?


WWW
« Reply #1 on: October 09, 2019, 04:26:21 PM »

Well, for what it's worth even debian installs 3 by default these days Smiley
Logged

If you have a poem, I have a tune, and we exchange these, we can both have a poem, a tune, and a song.
- Will
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #2 on: October 10, 2019, 02:05:13 AM »

Well, for what it's worth even debian installs 3 by default these days Smiley

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.
Logged

My online life: http://www.mellowood.ca
folderol
Kara-Moon Master
****
Posts: 5296

Who? Me?


WWW
« Reply #3 on: October 10, 2019, 03:12:51 PM »

Well, for what it's worth even debian installs 3 by default these days Smiley

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 Sad
Logged

If you have a poem, I have a tune, and we exchange these, we can both have a poem, a tune, and a song.
- Will
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #4 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.
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #5 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 Smiley .
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #6 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 Smiley

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

My online life: http://www.mellowood.ca
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #7 on: October 11, 2019, 05:23:35 PM »

I just read this and _think_ I understand it Smiley 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).
Logged

My online life: http://www.mellowood.ca
sciurius
Sr. Member
****
Posts: 443



« Reply #8 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.
Logged
bvdp
Kara-Moon Master
****
Posts: 1436


WWW
« Reply #9 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 Smiley I really think the first release in 2011 will be the one. And, in the meantime I will take out the 'env'.
Logged

My online life: http://www.mellowood.ca
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.048 seconds with 20 queries.