Page 1 of 5

Python3 migration

Posted: Sun Jan 20, 2019 4:57 pm
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.

Re: Python3 migration

Posted: Sun Jan 20, 2019 8:29 pm
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.

Re: Python3 migration

Posted: Wed Jan 23, 2019 4:54 pm
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...

Re: Python3 migration

Posted: Wed Jan 23, 2019 6:51 pm
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.

Re: Python3 migration

Posted: Wed Jan 23, 2019 7:14 pm
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

Re: Python3 migration

Posted: Wed Jan 23, 2019 7:24 pm
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.

Re: Python3 migration

Posted: Sat Jan 26, 2019 8:27 am
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?

Re: Python3 migration

Posted: Sat Jan 26, 2019 9:21 am
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.

Re: Python3 migration

Posted: Sat Jan 26, 2019 6:19 pm
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.

Re: Python3 migration

Posted: Sun May 05, 2019 8:50 pm
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?

Re: Python3 migration

Posted: Thu May 09, 2019 7:11 pm
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

Re: Python3 migration

Posted: Sun Jun 09, 2019 6:13 am
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.

Re: Python3 migration

Posted: Sat Jul 06, 2019 11:57 am
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.

Re: Python3 migration

Posted: Tue Aug 06, 2019 8:49 pm
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:

Re: Python3 migration

Posted: Wed Aug 07, 2019 3:36 am
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.