Hi all,
We're finally at a point where I see a fairly clear path to getting Chromium migrated over to Python3 (yes, we're very late in doing so), so I've written up a doc that outlines
a rough plan for doing so (it also includes
a FAQ!).
Executive summary: there are some bits of work left to do, but most of the necessary infra work needed to move things to python3 has been done, so I think it's safe to start moving things to be 3-compatible in earnest. But, We do not have an end date or a real project for this yet, and we need help.
Notably, assuming no one strongly objects, I'd like to land
this CL ASAP which will flip the bulk of the build's python actions to be run under 3 by default (though some stuff still needs to be and will be run under Python 2), so that we can start preventing new Python2-isms from landing.
Once we do that, I'd like to ask for help from folks to migrate their code over as needed so that we can get this over the finish line. I will be filing bugs to track the work that is needed and farming them out as I can best guess, but please feel free to ask how you can help as well.
This does not mean that we can drop Python 2 just yet. Python 2 is still required for large chunks of stuff, and my current thinking is that in order to avoid having everyone have to worry about which stuff can use new features and which can't, I'd like for us to try and migrate to code that is compatible with both 2 and 3 for now. It's been my experience with our codebase (and other 2->3 migrations) that this is fairly doable. If we find things where it really isn't, though, we can certainly revisit this aspect of the plan.
Also, my current thinking and the thinking of the infra team is that we can target Python 3.8 as the version of Python 3. 3.9 is still a little bleeding-edge, and it's starting to drop more things that were kept around 2-compatibility, so I suspect it'd be harder to write code that is 2- and 3.9-compatible.
If anyone has a build environment where they have Python3 but only some version that is older than 3.8 and upgrading to 3.8 will be an issue, please let me know ASAP!
Please let me know if you have any questions, either by replying to this thread,
commenting on the doc, or asking on python@. Once any dust from this thread settles, I'll also move that doc into //docs in the repo and update the Python
style guide and other docs as needed.
Thanks,
-- Dirk