Python3 migration

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderators: Committer, Committer

Post Reply
Message
Author
User avatar
Cjkjvfnby
AI Contributor
Posts: 459
Joined: Tue Jun 24, 2014 9:55 pm

Python3 migration

#1 Post by Cjkjvfnby » Sun Jan 20, 2019 4:57 pm

Being the last of the 2.x series, 2.7 will have an extended period of maintenance. Specifically, 2.7 will receive bugfix support until January 1, 2020. After the last release, 2.7 will receive no support.
https://www.python.org/dev/peps/pep-0373/

We have less than a year.

Why we need to migrate: Features we need implement:
  • decide which python should be used
    I prefer the newest one. I have no statistic about another OSs that supported by FreeOrion.
  • generate python3 API
    Boost can do it as I see
  • ship new python with Windows
    Looks easy
  • handle the case with embedded python on other platforms
    Need to choose python version and update OS requirements
  • update AI scripts
    The process is already started, still, need to do a lot. I think that we can do a compatible version as the first step and after migration just drop python2 support.
I will finish my study soon and can do AI script part.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12393
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Python3 migration

#2 Post by Geoff the Medio » Sun Jan 20, 2019 8:29 pm

Cjkjvfnby wrote:
Sun Jan 20, 2019 4:57 pm
We have less than a year.
While I support migrating to Python3 as soon as it can be done, I don't think the end of support for 2.7 is necessarily a deadline to do.

User avatar
Vezzra
Release Manager, Design
Posts: 4926
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Python3 migration

#3 Post by Vezzra » Wed Jan 23, 2019 4:54 pm

Geoff the Medio wrote:
Sun Jan 20, 2019 8:29 pm
I don't think the end of support for 2.7 is necessarily a deadline to do.
I suspect once Python 2.7 doesn't receive any security updates anymore, it will be removed from the various Linux distros quite quickly. So, if we don't want FO to stop working on Linux, I guess we need to migrate within the year...

Morlic
AI Contributor
Posts: 268
Joined: Tue Feb 17, 2015 11:54 am

Re: Python3 migration

#4 Post by Morlic » Wed Jan 23, 2019 6:51 pm

Cjkjvfnby wrote:
Sun Jan 20, 2019 4:57 pm
[*] update AI scripts
The process is already started, still, need to do a lot. I think that we can do a compatible version as the first step and after migration just drop python2 support.
For completeness: The rest of the python scripts (e.g. universe generation) must be updated as well.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

o01eg
Programmer
Posts: 388
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#5 Post by o01eg » Wed Jan 23, 2019 7:14 pm

Looks like ubuntu xenial 16.04 as Linux minimal base should be dropped too because it doesn't have boost compiled with python3 support: https://packages.ubuntu.com/xenial-upda ... on1.58-dev
Next version is bionic 18.04 with two boost version with python3-dev (3.6) dependencies: https://packages.ubuntu.com/bionic/libd ... on1.65-dev https://packages.ubuntu.com/bionic/libd ... on1.62-dev
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-09.bd1b188.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

o01eg
Programmer
Posts: 388
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#6 Post by o01eg » Wed Jan 23, 2019 7:24 pm

If to move from Ubuntu to Debian then it will be Debian 9 Stretch with https://packages.debian.org/stretch/lib ... on1.62-dev depends on 3.5 python3-dev.
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-09.bd1b188.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
Cjkjvfnby
AI Contributor
Posts: 459
Joined: Tue Jun 24, 2014 9:55 pm

Re: Python3 migration

#7 Post by Cjkjvfnby » Sat Jan 26, 2019 8:27 am

o01eg wrote:
Wed Jan 23, 2019 7:24 pm
If to move from Ubuntu to Debian then it will be Debian 9 Stretch with https://packages.debian.org/stretch/lib ... on1.62-dev depends on 3.5 python3-dev.
In Windows builds we ship all libs with the game. Any reason why we rely on local versions of libs for other platforms?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

o01eg
Programmer
Posts: 388
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#8 Post by o01eg » Sat Jan 26, 2019 9:21 am

Cjkjvfnby wrote:
Sat Jan 26, 2019 8:27 am
o01eg wrote:
Wed Jan 23, 2019 7:24 pm
If to move from Ubuntu to Debian then it will be Debian 9 Stretch with https://packages.debian.org/stretch/lib ... on1.62-dev depends on 3.5 python3-dev.
In Windows builds we ship all libs with the game. Any reason why we rely on local versions of libs for other platforms?
Because on other (Linux) platforms dependencies are already shipped with distributive.
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-09.bd1b188.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
Cjkjvfnby
AI Contributor
Posts: 459
Joined: Tue Jun 24, 2014 9:55 pm

Re: Python3 migration

#9 Post by Cjkjvfnby » Sat Jan 26, 2019 6:19 pm

o01eg wrote:
Sat Jan 26, 2019 9:21 am
Cjkjvfnby wrote:
Sat Jan 26, 2019 8:27 am
o01eg wrote:
Wed Jan 23, 2019 7:24 pm
If to move from Ubuntu to Debian then it will be Debian 9 Stretch with https://packages.debian.org/stretch/lib ... on1.62-dev depends on 3.5 python3-dev.
In Windows builds we ship all libs with the game. Any reason why we rely on local versions of libs for other platforms?
Because on other (Linux) platforms dependencies are already shipped with distributive.
It is cool that they are so cooperative and put the same dependencies at each Linux.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

o01eg
Programmer
Posts: 388
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#10 Post by o01eg » Sun May 05, 2019 8:50 pm

Since https://github.com/freeorion/freeorion-sdk/pull/46 was merged and Linux CI supports both Python 2 and 3 should Windows and MacOS SDKs add python 3 support?
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-09.bd1b188.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

o01eg
Programmer
Posts: 388
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#11 Post by o01eg » Thu May 09, 2019 7:11 pm

o01eg wrote:
Sun May 05, 2019 8:50 pm
Since https://github.com/freeorion/freeorion-sdk/pull/46 was merged and Linux CI supports both Python 2 and 3 should Windows and MacOS SDKs add python 3 support?
I've tried to do it myself: https://github.com/freeorion/freeorion-sdk/pull/48
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-09.bd1b188.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

o01eg
Programmer
Posts: 388
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#12 Post by o01eg » Sun Jun 09, 2019 6:13 am

o01eg wrote:
Thu May 09, 2019 7:11 pm
o01eg wrote:
Sun May 05, 2019 8:50 pm
Since https://github.com/freeorion/freeorion-sdk/pull/46 was merged and Linux CI supports both Python 2 and 3 should Windows and MacOS SDKs add python 3 support?
I've tried to do it myself: https://github.com/freeorion/freeorion-sdk/pull/48
I've managed to build SDK with both Pythons support but run into Boost.GIL incompatible changes.
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-09.bd1b188.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

o01eg
Programmer
Posts: 388
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#13 Post by o01eg » Sat Jul 06, 2019 11:57 am

o01eg wrote:
Sun Jun 09, 2019 6:13 am
I've managed to build SDK with both Pythons support but run into Boost.GIL incompatible changes.
Boost.GIL changes was already accepted. I had wrong built environment due parallel installed vcpkg. Now both https://github.com/freeorion/freeorion-sdk/pull/48 and https://github.com/freeorion/freeorion-sdk/pull/50 ready to be merged.
Gentoo Linux x64, gcc-8.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to slow multiplayer game at freeorion-lt.dedyn.io. Version 2019-07-09.bd1b188.
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

Post Reply