FoundationsTPythonVersions

Revision 19 as of 2012-04-25 20:30:18

Clear message

Shipping only Python 3 on the 12.10 CD

For many cycles Ubuntu developers have been working on a migration to Python 3. This has taken modest steps leading up to 12.04, with many packages (primarily libraries) getting Python 3 versions upstream, into Debian, and into Ubuntu. Python 3 is not distributed on the Ubuntu 12.04 CD images though, but major milestones have been reached, such as the porting of dbus-python to Python 3.2.

It is a release goal for Ubuntu 12.10 (Q cycle) that we ship only Python 3 on the desktop CD 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 on the desktop CD (or more specifically, those packages with Task: ubuntu-desktop (also minimal and standard) to be running on Python 3.

The ultimate goal is really to relegate Python 2 to universe for 14.04 LTS.

The Q-series blueprint exists for planning the UDS-Q 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 12.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:

  • white background - status unknown or Python 3 version currently unavailable
  • yellow background - Python available (or nearly so) in upstream and/or Debian. May need Debian packaging/update, or sync to Ubuntu
  • blue - Canonical/Ubuntu is the upstream. This doesn't mean you can't or shouldn't help port it, just that we know who to lean on at crunch time. Smile :)

  • green background - Python 3 version now available in Ubuntu!
  • red background - Python 3 port likely impossible due to upstream orphan, resistance, or infeasibility

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

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:

  • Find an alternative that does already support Python 3
  • Encourage and help upstream to do the port
  • Port it ourselves and contribute to upstream
  • Fork or rewrite from scratch

Candidates for Python 3 porting:

  • Software Center (LP: #823254)
  • Update Manager
  • Jockey
  • gwibber backend
  • Computer Janitor

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

Known blockers and issues

  • If we're to carry multiple versions of Python 3 (e.g. 3.2 and 3.3), how does dh_python3 handle situations where modules don't support all supported Python 3 versions? This is unsolved, although often discussed in debian-python.
  • Namespaces (not PEP 382 or 402 though; Eric Smith's as yet unreleased new PEP)
  • xapian
  • gstreamer

Warning: Ubuntu Software Center currently plans to stay on Python 2.7. dbus and xapian are the main blockers to moving to Python 3. Talk to Michael Vogt for more details. —mpt

Resources

Python 3 packaging

Python3 packaging is covered in this packaging best practices guide. However dh_auto-* doesn't yet support Python 3. There's was a Debian GSoC project to write a new tool before fixing dh (python-multibuild tool to be later integrated). It needs work (Piotr in debian-python is leading this now). Until this lands, we should just continue using overrides in the meantime. Distutils packages can override these easily, however other packages may be non-trivial.

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