Firefox/Python 3 Migration: Difference between revisions
< Firefox
Jump to navigation
Jump to search
(Created page with "== Why This is Important == In mozilla-central there are over 3500 Python files (excluding third party files), comprising roughly 230k lines of code. Most of it is Python 2.[...") |
(→How to Port the Code: Initial porting guide) |
||
| Line 16: | Line 16: | ||
== How to Port the Code == | == How to Port the Code == | ||
* Make sure you can test the code you're working on with python3! | |||
** If using `tox`, then adding `py35`, and `py36` to the list of environments should be sufficient | |||
* [http://python-future.org/futurize.html#stage-1-safe-fixes `futurize`]` can be used to transform code into code that's compatible with both python2.7 and python3 | |||
* The `six` module is available in-tree, feel free to use it as a dependency | |||
== References == | == References == | ||
Revision as of 17:49, 30 May 2019
Why This is Important
In mozilla-central there are over 3500 Python files (excluding third party files), comprising roughly 230k lines of code. Most of it is Python 2.[1]
Python 2 will reach it's End Of Life on January 1st 2020. This page collects links and resources to assist the migration of the Firefox ecosystem off of Python 2 and onto Python 3.
Getting Involved
Find the others
Most discussion happens in the #python channel on Slack (NDA'd Mozillians only).
Find a place to start hacking
Bug 1496527 tracks the migration work across Firefox.
How to Port the Code
- Make sure you can test the code you're working on with python3!
- If using `tox`, then adding `py35`, and `py36` to the list of environments should be sufficient
- `futurize`` can be used to transform code into code that's compatible with both python2.7 and python3
- The `six` module is available in-tree, feel free to use it as a dependency