Shipping only Python 3 on the 14.04 CD

For many cycles Ubuntu developers have been working on a migration to Python 3. This will continue as we strive to remove Python 2 from various images, in decreasing order of priority:

It is a release goal for Ubuntu 14.04 (Trusty Tahr) that we ship only Python 3 on the touch, server, and desktop images. Don't worry, Python 2.7 will still be available in the archive, and more specifically 'main' for now. But we want all libraries and applications to be running on Python (specifically, those packages with Task: ubuntu-desktop (also minimal, standard, and server - there is no task for Touch images).

The T-series blueprint exists for planning the vUDS 1310 session, holding work items, etc.

This Google document captures the set of packages and leaf applications that still need packaging or porting as of Ubuntu 14.04. This list was generated with the oncd.py script from this branch. WE NEED YOUR HELP!. Some packages have Python 3 support upstream but are not yet packages for Ubuntu. Others do not yet have Python 3 support. In those cases we must either help the upstream to land Python 3 support or rewrite our applications to not require the unported dependency.

Spreadsheet legend:

(See the Status column of each package for additional details.)

Rationale

Plan

The plan is to identify a handful of desktop applications included on the default install, follow their dependency stack, and investigate whether their upstreams already support Python 3 (either in a released version, a development branch, or fork). For those which have no upstream support yet, we have several choices:

There is no plan to make Python 3 the default /usr/bin/python. See for upstream policy on this.

Side Effects

Even though this task is ostensibly to port only those packages on the various official images, it will have some effects on other flavors and installations. For example, once Ubiquity and Update Manager are ported, all flavors will have to ship the Python 3 version, meaning they will probably end up shipping both Python 2 and 3 (consuming some additional disk space).

Also, there is an impact on optional software. A good example are the Suggests for duplicity, which add some optional behavior. These packages (e.g. python-boto, python-cloudfiles, python-paramiko) are not seeded on the desktop CD, so aren't in the critical path for porting, but not having them would reduce the functionality of the parent tool. In these cases, we would still like to have Python 3 ports, and in the spreadsheet above, you'll see them listed under "Good to Have".

It is indeed true that this means /usr/bin/python will not exist on a fresh install from desktop CD until it's installed explicitly, or implicitly by way of an unported dependency. /usr/bin/python3 will exist though.

Known blockers and issues

Warning: Ubuntu Software Center currently plans to stay on Python 2.7. Xapian is the main blockers to moving to Python 3. Upstream Xapian has an experimental port not yet merged to their trunk. Software Center may ultimately go away anyway.

Resources

Python 3 packaging

Python3 packaging is covered in this packaging best practices guide. Use pybuild for best results.

Historical reference

As mentioned, we've actually been working on this spec since the Maverick days. Here is some historical information from the whiteboard:

See also this wiki page for detailed background:

Full UDS-O session notes: http://pad.ubuntu.com/uds-o-foundations-o-python-versions

Python/FoundationsTPythonVersions (last edited 2013-11-15 21:49:11 by mail)