Community mailing list archives

community@mail.odoo.com

Avatar

Odoo 11 - Python 3

by
Olivier Dony (odo)
- 09/15/2017 12:16:33
Hi everyone,

As promised in past discussions about Python 3 support, we've been working over the last few months on converting the Odoo source code to make it compatible with Python 3.

The "master" branch of Odoo currently runs on both Python 2.7 and Python 3.5+, thanks to the excellent work of @xmo-odoo :-)
Our CI platform (runbot) now runs the testsuite with Python 3.5, according to the version selected in the odoo-bin script.

The time has come to choose the officially supported Python version for Odoo 11. We have to rule out dual compatibility, because it represents a significant overhead for continuous testing and bug fixing.

So Odoo 11 will only support Python 3, starting with Python 3.5. 

Python 3 has been around since 2008, and all Python libraries used by the official Odoo distribution have been ported and are considered stable. Most supported platforms have a Python 3.5 package, or a similar way to deploy it. So there seems to be little reason to delay the transition further. The community has been asking for a move to P3 for a long time, let's deal with it ;-)

Porting third-party/community modules should not be very difficult, as long as they do not depend on libraries P2-only libraries. @xmo-odoo has started a (draft) guide about porting P2 Odoo modules to make them work under both Python 2.7 and Python 3.5.
We're also considering backporting the minimal "pycompat" compatibility shim in Odoo 10, to ease the development of cross-version modules, if there is enough interest.
We'll also have a dedicated Python 3 talk at Odoo Experience in October.

Regarding the Odoo framework and official modules, we won't intentionally break Python 2.7 compatibility in v11, because that would be extra noise in the code, and we want to keep the changes minimal, as always. The master branch runs under Python 2.7 at the moment, so the 11.0 branch will, too. We won't add new features in v11 after the freeze, and minimal bugfixes should not typically use newer P3 features, so this might stay true for a while. But we won't be able to really guarantee P2 compatibility as time passes, without incurring the overhead mentioned above.

Follow-Ups