Status

enhancement
P3
normal
ASSIGNED
2 years ago
4 months ago

People

(Reporter: emin, Assigned: jotes)

Tracking

(Depends on 1 bug)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

After 3 years python 2.x will be discontinued. Also new features will not come to python 2.x anymore. Also python 3.x consumes less memory in string variables (optimized for Unicode) and works a bit faster.

# Statements in wiki[1]:

List of features that will not be backported to python 2.x:
* strings are Unicode by default
* clean Unicode/bytes separation
* exception chaining
* function annotations
* syntax for keyword-only arguments
* extended tuple unpacking
* non-local variable declarations

Heroku supports python-3.6.1 runtime. Some operating systems (Linux distributions) are already using python 3.x as default.

# What needs to be done:
1. Checking all dependencies for python 3.6 support.
2. Updating documentation (for example specifying python version for virtualenv as MacOS and some Linux distros are currently using python 2.x as default).
3. Checking and updating code to support it.

I'll be happy to work on it, but as it is a major change, it needs to be discussed. Mostly about what can be side effects and etc.

[1] https://wiki.python.org/moin/Python2orPython3
Flags: needinfo?(mkelly)
Flags: needinfo?(m)
Thanks for filing, Emin!

I don't have enough insight right now, so I'm removing the NI.
Flags: needinfo?(m)
As of dependencies, compare-locales isn't py3 yet, and I don't expect to invest in an update on that until we can use python3 in the firefox build system. translate-toolkit seems to be fine with py3.

Also, django 2 will not support python 2 (oh the irony).
I don't have any major insight except "Yes, do this yesterday."

For dependencies like compare-locales, I'd recommend using six[1] to make them both Python 2 and Python 3 compatible. You can use tox[2] to help run your test suite under multiple versions of Python easily, as well.

[1] https://pythonhosted.org/six/
[2] https://tox.readthedocs.io/en/latest/
Flags: needinfo?(mkelly)
Priority: -- → P3
depends on bug 1386193
Depends on: 1388313
An interesting read on how Socorro got migrated to Python 3:
https://bluesock.org/~willkg/blog/mozilla/socorro_python3.html

A note from Pike:
"Splitting up requirements into requirements and constraints sounds nice"
Assignee: nobody → poke
Status: NEW → ASSIGNED
Summary: Updating environment to python 3.6 → Upgrade to python 3.6
Depends on: 1536670
Depends on: 1537613
Depends on: 1541252
Depends on: 1541260
Depends on: 1542084
You need to log in before you can comment on or make changes to this bug.