Porting to python3
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Porting to python3
Is the initial strategy to achieve Py2/Py3 compatible FreeCAD still realistic and does it still make the most sense?
- kkremitzki
- Veteran
- Posts: 2511
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Porting to python3
Python 2 EOL is in like 20 months so I think the sooner we're "all 3", the better.
Re: Porting to python3
as nobody wants to do work twice, I wouldn‘t support both versions. I find myself using py2 incompatible syntax in other projects quite often, allthough I know it's not going to work with py2. mainly this are:
- * operator for unpacking works not only for arguments.
- @ operatot for numpy array matrx multiplication
so once we switch, we will have the opposite problem like we have now.
- * operator for unpacking works not only for arguments.
- @ operatot for numpy array matrx multiplication
so once we switch, we will have the opposite problem like we have now.
Re: Porting to python3
Therefore how will we approach to resolve this chicken or the egg dilemma? Continue to be frustrated for the next 2 years. Trying to fulfill the idea of maintaining full Py2/Py3 compatibility. Or do something else? Or both?
Re: Porting to python3
I once said, that we should move as early as possible. This was about 2 years ago Many py3 incompatible lines have been produced in the meantime. Macros won't work after updating to py3. Porting them should be quite simple, but it's simple frustrating to deal with this issues....
I guess a simple statement to not support py2 for the next release /release cycle will fix this issue. I know that is painful, but it doesn't get much better if we wait until 2020 or die with py2...
I guess a simple statement to not support py2 for the next release /release cycle will fix this issue. I know that is painful, but it doesn't get much better if we wait until 2020 or die with py2...
Re: Porting to python3
My two cents:
I think we should go this way. Make into the Roadmap of v0.18 only supporting py3. The reasons are:
1. Py2 and Py3 compatibility sinks effort and developer time.
2. With the release of v0.17 it ends the introduction of py3 incompatible code. It should be a requirement that anything merged into v0.18 is py3 compatible.
3. v0.17, once released, will be short-living, as we plan to release v0.18 around the end of this year. This will allow to have two reasonably similar versions from a functionality point of view, one supporting python2 (v0.17), the other python3 (v0.18). I think this is a perfect bridge (at least when faced with the egg/chicken problem) to disrupt users as little as possible, while allowing to create awareness and move all other tools, 3rd party WB and macros that have not been adapted during v0.18 development cycle (hopefully very little of them), during v0.19 development cycle. This should allow to bring all python tools together for the release of v0.19, in time for the 2020 shutdown.
Probably 3rd party python tools will need either to adapt to have two branches, one for py2 (addonmanager of v0.17 pointing there) and another for py3( addonmanager of v0.18 pointing there). Hopefully the development of such tools for py3 will gain moment from the decision of the Roadmap for v0.18.
Re: Porting to python3
Not sure to be honest. If such switch will happen in FreeCAD 0.18 development cycle. I somehow doubt that. Therefore Py2/Py3 compatibility cruft will likely just continue to build up?
Re: Porting to python3
Sorry, but
When was the last time that two releases of FreeCAD were spaced less than 9 months apart? Years ago, when the project was much smaller. It's been 2 1/2 months since Werner talked of a 0.17 release. If 0.18 is to be released by year's end, and if a 2-3 months period is required to preparare for a release, that leaves 6-7 months of development.
Re: Porting to python3
From my point of view we should finish the Py3 port ASAP when starting with v0.18 development. I would then make Py3 the default version but keep Py2 specific code for a while.please give us some insights about your plans regarding py3.