Porting to python3

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
User avatar
kkremitzki
Posts: 326
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Porting to python3

Postby kkremitzki » Tue Feb 21, 2017 5:11 pm

flutefreak7 wrote:I just wanted to say I'm really excited to see the Python 3 work happening! I've been randomly checking the internet for some of the CAD related tools to be ported to Python 3 ever since I started with Python around 7 years ago and I'm really excited to see all the effort you guys are putting in!

I'm unfortunately not very skilled with C++, but I might could help with translating Python 2 idioms to Python 3 or end user testing or something once I'm more up to speed with FreeCAD. I feel bad just being a needy user and not helping out more, but I do want to say that your work will be appreciated!

Good to see you're willing to help! One of the first things, I think, is making sure you can built and run FreeCAD with Python 3 enabled on your machine. If you have questions or need help in doing so feel free to ask.
looo
Posts: 706
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Postby looo » Sun Mar 12, 2017 1:35 pm

After all the diff for src/Mod of the python3 branch is in master, the rebasing isn't that time intensive anymore. Building Path with python3 is again broken, because of some new Int->Long conflicts. Also fem has some issues, but only at runtime... but that is not a big issue right now.

To make the python3 things more stable we have to get travis to work with python3. But therefor the full branch has to move to master. I don't have a plan right now how to do this. So I am open for suggestions:
how can we test python3 things automatically without moving all into master. Is there a tool to do an automatic rebase? And can we setup a branch which is tested to build with python3 for every PR?
Or should we push towards a python3 compatible master. This means that there will most likely break some things. Not that a big problem,... but it's always annoying for others...

Btw.: The up to date python3 branch has moved to https://github.com/looooo/FreeCAD/tree/py3-23
User avatar
Kunda1
Posts: 635
Joined: Thu Jan 05, 2017 9:03 pm

Re: Porting to python3

Postby Kunda1 » Mon Mar 27, 2017 6:06 pm

BTW, any commits that are related to porting to python3 please link them to issue #995
In the commit message you can write

Code: Select all

issue #995
in order to auto-link it in MantisBT. See https://freecadweb.org/wiki/tracker#Att ... o_a_ticket
simonvanderveldt
Posts: 29
Joined: Tue Mar 14, 2017 2:11 pm

Re: Porting to python3

Postby simonvanderveldt » Mon Mar 27, 2017 6:24 pm

looo wrote:After all the diff for src/Mod of the python3 branch is in master, the rebasing isn't that time intensive anymore. Building Path with python3 is again broken, because of some new Int->Long conflicts. Also fem has some issues, but only at runtime... but that is not a big issue right now.

To make the python3 things more stable we have to get travis to work with python3. But therefor the full branch has to move to master. I don't have a plan right now how to do this. So I am open for suggestions:
how can we test python3 things automatically without moving all into master. Is there a tool to do an automatic rebase? And can we setup a branch which is tested to build with python3 for every PR?
Or should we push towards a python3 compatible master. This means that there will most likely break some things. Not that a big problem,... but it's always annoying for others...

Btw.: The up to date python3 branch has moved to https://github.com/looooo/FreeCAD/tree/py3-23

I'm not 100% sure I understand the issue, but you can simply add python3 to Travis's matrix and then instruct Travis to not fail the build on Python 3 using allow_failures. See https://docs.travis-ci.com/user/customi ... ed-to-Fail for details