Porting to python3

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
damian
Posts: 583
Joined: Sun May 31, 2015 6:16 pm

Re: Porting to python3

Post by damian »

triplus wrote:P.S. And as for Qt 5 builds on Ubuntu 16.04. Don't try using cmake-gui for now as that results in Qt 4 libraries being used and compile procedure to not complete successfully. Instead "cmake -DBUILD_QT5=1" should be used without involving the cmake-gui.
Thank you

Code: Select all

cmake /home/damian/freecad-qt -DBUILD_QT5=1 -DPYTHON_EXTENSION_SUFFIX=-python2.7-x86_64-linux-gnu
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10967 (Git)
Build type: Unknown
Branch: master
Hash: 38388cf650ef49cbce48af5dd33bdbe2487c8cbe
Python version: 2.7.12
Qt version: 5.5.1
Coin version: 4.0.0a
OCC version: 7.1.0
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Post by looo »

as there are some misunderstandings regarding the python3 port I want to show you this dependency graph, which shows the run-time dependency of freecad-py3 with conda.
env-fc_graph.png
env-fc_graph.png (732.84 KiB) Viewed 2024 times
The yellow baloons are packages currently not available on ubuntu. These can be found here:
[1] freecad for python3: https://github.com/looooo/FreeCAD/tree/py3-26
[2] pivy for python3: https://github.com/looooo/pivy (the origin branch is unmaintained. No response. So this fork should be the successor)
[3] netgen6.2: https://github.com/looooo/netgen (this branch has some diff to the netgen master branch, but a patch was send to upstream. not included yet)

pyside2 is qt5 specific! There is no need for pyside2 with python3. There was once a problem with windows, but peterl94 has back-ported a fix for pyside2 to pyside, so this is no show-stopper anymore...
User avatar
CADennis
Posts: 31
Joined: Tue Apr 18, 2017 10:12 am

Re: Porting to python3

Post by CADennis »

looo wrote:[...] I want to show you this dependency graph, which shows the run-time dependency of freecad-py3 with conda. [...]
I think the dependency graph is a very helpful thing we should autogenerate and archive as part of the after-install actions for each build, just before the tests are run. Can you lend us the python snippet to generate that, please?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Post by looo »

script can be found here: https://github.com/looooo/FreeCAD_Conda ... y-graph.py
but it uses meta-data from a conda-environment.
User avatar
CADennis
Posts: 31
Joined: Tue Apr 18, 2017 10:12 am

Re: Porting to python3

Post by CADennis »

looo wrote:[...] but it uses [...] from a conda-environment. [...]
I was fearing you'd write that :lol:
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Porting to python3

Post by looo »

https://askubuntu.com/questions/261772/ ... -a-package

but for freecad it didn't open. The picture was simple too big ;) python-pivy already produces a big picture.
User avatar
CADennis
Posts: 31
Joined: Tue Apr 18, 2017 10:12 am

Re: Porting to python3

Post by CADennis »

@damian and @triplus, could you please post here your debtreePNG output of whatever you get running, even the Python2 as in your case damian. Thank you!
@looo and other RPM users:
For CentOS, Fedora, openSuse and other RPMs, I found http://xmodulo.com/check-rpm-package-de ... -rhel.html , in particular "Method 4 - rpmdep" , also documented here: https://www.mankier.com/1/rpmdep
The mentioned DOT file as output is enough. In case you don't know, that is translated by GraphViz into PNG, just as the one looo posted above.
we'll get there 8-)
User avatar
CADennis
Posts: 31
Joined: Tue Apr 18, 2017 10:12 am

Re: Porting to python3

Post by CADennis »

looo wrote:[...]but for freecad it didn't open. The picture was simple too big [...]
just post the DOT as [ code ] here, I'll extract the needed depth myself, looo
User avatar
CADennis
Posts: 31
Joined: Tue Apr 18, 2017 10:12 am

Re: Porting to python3

Post by CADennis »

looo wrote:[via PM, looo just offered even more assistance and clarification]
thanks looo, I hope triplus can identify a configuration with which we could start as a "reference Ubuntu PIP-only" compiling against Python3. I'll try to handle CONDA as yet another OS, a "virtual OS for developers", besides OSX, WIN, Ubuntu, Fedora, so we'll run it as an equitable "OS" variant in our build dimension matrix. Well, maybe several variants of CONDA, maybe something like this

Code: Select all

{Win10, macOS10, Ubuntu16.04, Ubuntu14.04, Fedora<xyz>, Gentoo32bit, CONDA-Win, CONDA-Centos}
that times

Code: Select all

x {Python2.7, Python3.5, Python3.6-dev}
x {QT4, QT5}
x {Eigen2-release, Eigen3-release}
will already cause enough trouble and require explicit combination filters. Is that fair enough?
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Porting to python3

Post by triplus »

@looo

Thanks for the additional explanation.

Hi @CADennis.

Realistically i won't have the time before Thursday. As if there wouldn't be additional requirements from Pivy/Netgen6.2 side i likely could find enough time today to try to create a build. But as this things usually take much more time than anticipated i feel that today i don't have enough time available for this.
CADennis wrote:@damian and @triplus, could you please post here your debtreePNG output of whatever you get running, even the Python2 as in your case damian. Thank you!
You use Ubuntu 16.04 and if you followed the procedure to compile FreeCAD (Python2/Qt4):

https://www.freecadweb.org/wiki/CompileOnUnix#Ubuntu

You have the exact same system and dependencies as i have. In addition:
looo wrote:pyside2 is qt5 specific! There is no need for pyside2 with python3.
My suggestion would be forget about Qt 5 altogether for now as it is not strictly needed for Python 3 port related work. Do whatever you plan to do in the scope of Python3/Qt4 first. And lets see where does that take us after. And if it can help with Python 3 porting effort in a way it will speed things up.
Post Reply