Python3 migration

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

Moderator: Committer

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

Python3 migration

#1 Post by Cjkjvfnby »

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: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Python3 migration

#2 Post by Geoff the Medio »

Cjkjvfnby wrote: Sun Jan 20, 2019 4:57 pmWe 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: 6090
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Python3 migration

#3 Post by Vezzra »

Geoff the Medio wrote: Sun Jan 20, 2019 8:29 pmI 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: 296
Joined: Tue Feb 17, 2015 11:54 am

Re: Python3 migration

#4 Post by Morlic »

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: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#5 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Python3 migration

#6 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Python3 migration

#7 Post by Cjkjvfnby »

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: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#8 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Python3 migration

#9 Post by Cjkjvfnby »

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: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#10 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Python3 migration

#11 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Python3 migration

#12 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Python3 migration

#13 Post by o01eg »

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-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

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

Re: Python3 migration

#14 Post by Cjkjvfnby »

As I understand python 3.5.7 is included to SDK.

I don't know how to switch to it, can you provide instructions?

Why 3.5.7? I will miss dataclasses 3.7 and Formatted string literals 3.6:
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: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#15 Post by o01eg »

Cjkjvfnby wrote: Tue Aug 06, 2019 8:49 pm As I understand python 3.5.7 is included to SDK.

I don't know how to switch to it, can you provide instructions?

Why 3.5.7? I will miss dataclasses 3.7 and Formatted string literals 3.6:
SDK not yet moved. It still should be tagged.

Debian and Ubuntu for appropriate boost version have 3.5 and 3.6 python version.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Post Reply