Python3 migration

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

Moderator: Committer

Message
Author
User avatar
adrian_broher
Programmer
Posts: 1155
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Python3 migration

#46 Post by adrian_broher »

Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm C++ changes: Looks like it is almost done for AI, what about UniverseGeneration and TurnEvents?
There shouldn't be that much to do. Enabling the python 3 binding building in the SDK is one thing, selecting the python 3 binding in the build system the other. Everthing else should start to work by itself then, except testing if the Python scripts were updated properly.
Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm Linux, mac build: Do we need to do something here or it will work from the box?
Windows build: We need to ship python binaries together with the installer.
Both related to updating the packaging scripts.
Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm [*] Linux distributives
Some distributives excluded FreeOrion from their repositories, need to fix that. I am not familiar with that world.
Aside from poking the packagers there is not much to do. Also what is a "distributive"?
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

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

Re: Python3 migration

#47 Post by o01eg »

Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm
  • C++ changes.
    Looks like it is almost done for AI, what about UniverseGeneration and TurnEvents?
Python-C++ glue is common for AI, universe generator, and turn events.
Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm
  • Linux, mac builds.
    Do we need to do something here or it will work from the box?
Linux is done.
Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm
  • Windows build.
    We need to ship python binaries together with the installer.
SDK is ready but isn't released yet.
Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm
  • Remove compatibility from the python code
    I don't know if we want to do it in the release or later.
I think we should only disable tests for 2.7.
Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm
  • Linux distributives
    Some distributives excluded FreeOrion from their repositories, need to fix that. I am not familiar with that world.
I hope they will take FreeOrion back after migration.
Gentoo Linux x64, gcc-9.3, boost-1.72.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 0.4.10.1.
Donations are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

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

Re: Python3 migration

#48 Post by Vezzra »

Cjkjvfnby wrote: Sun Feb 09, 2020 6:01 pm Migration to python3 will be delivered in the next release.

Do we plan to release any other features?
No. If something gets done alongside the migration to Python3 and is finished and ready in time so it can be included, it will, but I do not want to block the release for any other features than the Python3 stuff.
Linux, mac builds.
Do we need to do something here or it will work from the box?
As far as I can tell, there is nothing special to be done for the Linux platform (there is no Linux distro which doesn't support Python3 at this point to my knowledge). On macOS however we need to ship the Python3 framework instead of Python2, which means the app generation procedure needs to get updated accordingly.

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

Re: Python3 migration

#49 Post by o01eg »

What about SDK release? It doesn't left many big python3 errors to fix.
Gentoo Linux x64, gcc-9.3, boost-1.72.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 0.4.10.1.
Donations are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

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

Re: Python3 migration

#50 Post by Cjkjvfnby »

There are no more pylint warnings about python3 compatibility.
It does not mean that code compatible, o01eg has encountered a lot of errors that was not reported by this tool.

GitHub has some project management features. I will try to play with it. Forum is not best place to figure out what need to be done.

I think the next step will be to finish with these PRs:

https://github.com/freeorion/freeorion/pull/2431
https://github.com/freeorion/freeorion/pull/2776
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: 943
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#51 Post by o01eg »

I suppose the most important step is to release SDK.
Gentoo Linux x64, gcc-9.3, boost-1.72.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 0.4.10.1.
Donations are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

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

Re: Python3 migration

#52 Post by Vezzra »

Has the master branch of the SDK already received all the patches required for the switch to Python3?

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

Re: Python3 migration

#53 Post by Geoff the Medio »

Vezzra wrote: Sun Feb 23, 2020 6:25 pm Has the master branch of the SDK already received all the patches required for the switch to Python3?
And would a new SDK release also still support Python2?

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

Re: Python3 migration

#54 Post by o01eg »

Vezzra wrote: Sun Feb 23, 2020 6:25 pm Has the master branch of the SDK already received all the patches required for the switch to Python3?
Yes, I've built freeorion with python3 from master SDK.
Geoff the Medio wrote: Sun Feb 23, 2020 6:29 pm
Vezzra wrote: Sun Feb 23, 2020 6:25 pm Has the master branch of the SDK already received all the patches required for the switch to Python3?
And would a new SDK release also still support Python2?
Yes, SDK builds both python and boost-python libraries.
Gentoo Linux x64, gcc-9.3, boost-1.72.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 0.4.10.1.
Donations are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

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

Re: Python3 migration

#55 Post by Cjkjvfnby »

I have created a project on github.

Main purpose to track all things to be done in one place.

If you know that something to be done please create a card and add it tot he project.

If you have already done something just create a card and move it to done. Like new SDK with python3 support (is it cross platform?).

https://github.com/freeorion/freeorion/projects/10
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: 943
Joined: Sat Dec 10, 2011 5:46 am

Re: Python3 migration

#56 Post by o01eg »

Long awaited SDK was looked so near...
Gentoo Linux x64, gcc-9.3, boost-1.72.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 0.4.10.1.
Donations are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

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

Re: Python3 migration

#57 Post by Vezzra »

Well, it shouldn't be long now... ;)

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

Re: Python3 migration

#58 Post by o01eg »

SDK is released! :mrgreen:
Gentoo Linux x64, gcc-9.3, boost-1.72.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 0.4.10.1.
Donations are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

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

Re: Python3 migration

#59 Post by o01eg »

Gentoo Linux x64, gcc-9.3, boost-1.72.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 0.4.10.1.
Donations are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

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

Re: Python3 migration

#60 Post by o01eg »

o01eg wrote: Wed Mar 11, 2020 4:04 am PR is ready to be merged: https://github.com/freeorion/freeorion/pull/2653
It's happening! :D
Gentoo Linux x64, gcc-9.3, boost-1.72.0
Ubuntu Server 18.04 x64, gcc-7.4, boost-1.65.1
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 0.4.10.1.
Donations are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

Post Reply