Python

Differences between revisions 8 and 10 (spanning 2 versions)
Revision 8 as of 2011-12-07 16:25:16
Size: 4318
Editor: mail
Comment:
Revision 10 as of 2012-04-19 16:39:41
Size: 4316
Editor: mail
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:

[[http://wiki.debian.org/Python/LibraryStyleGuide|Packaging best practices (including Python 3) for Python libraries in Debian]]
Line 20: Line 22:
== Plans for 12.04 == == Plans for 12.10 ==
Line 22: Line 24:
 * Shipping Python 3 on the 12.04 LTS CD [[https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-python-versions|blueprint]] [[/FoundationsPPythonVersions|wiki]]

The goal of this spec is to convert at least one, if not more, desktop applications from Python 2 to Python 3. In doing so, we'll begin the process of drilling down and porting each of those application's stack of dependencies. We'll claim some CD space for Python 3 (mitigated by the removal of Python 2.6 from Precise), and we'll begin to learn what we don't know. So while the title sounds (too) ambitious, the goals are actually fairly modest but critically important for future plans.

 * debhelper improvements for Python [[https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-python-dh-improvements|blueprint]] [[/FoundationsPPythonDhImprovements|wiki]]

The goal of this wiki is to improve support for both Python 2 and Python 3 in debhelper. We want to get {{{dh_auto_test}}} to automatically support standards for running Python test suites, and we want to develop and promote python-multibuild for support of Python 3.

 * Can we improve the LTS-to-LTS Python upgrade story? (again) [[https://blueprints.launchpad.net/ubuntu/+spec/foundations-p-python-lts-to-lts|blueprint]] [[FoundationsPPythonLTStoLTS|wiki]]

This was mostly a placeholder blueprint for discussion at UDS-P. During the session it was fairly clear (to me at least) that there isn't much we can do other than what we've already done. Projecting ahead with Python 3.3's current release schedule, and a typical 18 months between upstream Python releases, we'll probably see Python 3.4 around the time of Ubuntu 14.04's release. There's no way to tell what that transition might look like, so we just need to keep it in mind as we do our other Python work in Ubuntu and Debian.
It is a release goal to remove Python 2 from the desktop CD images for 12.10. There is a [[https://blueprints.launchpad.net/ubuntu/+spec/foundations-q-python-versions|blueprint for UDS-Q]] on the subject, a [[https://wiki.ubuntu.com/Python/FoundationsQPythonVersions|wiki page]] describing the effort, and a [[https://docs.google.com/a/canonical.com/spreadsheet/ccc?key=0AiT4gOXSkmapdFA1anRkWERsaXgtWnllUG9QWXhDVWc#gid=0|google spreadsheet]] tracking progress.
Line 36: Line 28:
 * Python 3 only on the ISO images. Yes, this means migrating everything in the default install to Python 3. We will never fully get rid of Python 2.7, but since there will also never be a Python 2.8, and Python 2.7 will be nearly 4 years old by the time of the 14.04 LTS release, it is time to relegate Python 2 to universe. Although it is too early to know right now, but we expect Python 3.4 to be the current release by the time of the 14.04 LTS.  * Move Python 2 to universe, port all Python applications in main to Python 3. We will never fully get rid of Python 2.7, but since there will also never be a Python 2.8, and Python 2.7 will be nearly 4 years old by the time of the 14.04 LTS release, it is time to relegate Python 2 to universe.

 * We will likely see [[http://www.python.org/dev/peps/pep-0398/|Python 3.3]] in time for 12.10. I recommend carrying both Python 3.2 and 3.3 for 12.10, with future support TBD.

 * Although it is too early to know right now (there won't even be a PEP until 3.3 is released), but we expect Python 3.4 to be the current release by the time of the 14.04 LTS. There's no way to tell what that transition might look like, so we just need to keep it in mind as we do our other Python work in Ubuntu and Debian. If I had to guess from previous LTS releases, we will likely carry just Python 3.4 for Ubuntu 14.04.

== Python 3 porting ==

There are lots of resources on the 'net for porting to Python 3, but some may be difficult to find or follow. There are also lots of opinions on how to best port and support Python 3. Here in Ubuntu, we make and promote opinionated choices with the intent of making it easier for our users and developers. It's okay to disagree and discuss these choices, but we have had successful experiences with them and feel that they provide the technically best recommendations. To that effort, please refer to our [[/3|guidelines for supporting Python 3 on Ubuntu]].

'''All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only.''' If you can't do this because of your dependency stack, let's talk.

Python on Ubuntu

Here is everything you ever wanted to know about Python on Ubuntu <wink>. Well, probably not, but let me know what essential information you think is missing and I'll work on updating it here. Or, since this is a wiki, you too can contribute!

The best thing to do is to start with the Python on Debian wiki page, since we inherit as much as possible from Debian, and we strongly encourage working with the great Debian Python teams to push our changes upstream. A useful way to look at it is this: because Ubuntu and Debian have different release cycles, namely that Ubuntu uses timed releases and Debian uses release-when-ready, we can use these to our advantage. Often, we can initiate big changes in Ubuntu first, using it to blaze a trail, and then systematically push those changes up into Debian, so that we can eventually remove as much of the delta from Ubuntu as possible. This was an effective model for both the Python 2.7 transition and the dh_python2 helper transition.

Here's a nice webified version of Barry's IRC tutorial on Python packaging. Thanks to Neil Wallace for putting this up.

Packaging best practices (including Python 3) for Python libraries in Debian

Deltas from Debian

The above wiki already describes where Debian deviates from upstream Python, and this section will outline how Ubuntu deviates from Debian. Hopefully, these deltas are even smaller.

  • In Ubuntu python-minimal is an Essential package. In Debian it is not. This is a long term delta.
  • Python 2.7 and Python 3.2 only in Ubuntu 12.04. With Precise Pangolin, we have dropped Python 2.6.

Bugs

Open bugs on Python packages in the archive: https://bugs.launchpad.net/~pythonistas/+packagebugs

Plans for 12.10

It is a release goal to remove Python 2 from the desktop CD images for 12.10. There is a blueprint for UDS-Q on the subject, a wiki page describing the effort, and a google spreadsheet tracking progress.

Longer term plans (e.g. 14.04)

  • Move Python 2 to universe, port all Python applications in main to Python 3. We will never fully get rid of Python 2.7, but since there will also never be a Python 2.8, and Python 2.7 will be nearly 4 years old by the time of the 14.04 LTS release, it is time to relegate Python 2 to universe.
  • We will likely see Python 3.3 in time for 12.10. I recommend carrying both Python 3.2 and 3.3 for 12.10, with future support TBD.

  • Although it is too early to know right now (there won't even be a PEP until 3.3 is released), but we expect Python 3.4 to be the current release by the time of the 14.04 LTS. There's no way to tell what that transition might look like, so we just need to keep it in mind as we do our other Python work in Ubuntu and Debian. If I had to guess from previous LTS releases, we will likely carry just Python 3.4 for Ubuntu 14.04.

Python 3 porting

There are lots of resources on the 'net for porting to Python 3, but some may be difficult to find or follow. There are also lots of opinions on how to best port and support Python 3. Here in Ubuntu, we make and promote opinionated choices with the intent of making it easier for our users and developers. It's okay to disagree and discuss these choices, but we have had successful experiences with them and feel that they provide the technically best recommendations. To that effort, please refer to our guidelines for supporting Python 3 on Ubuntu.

All Ubuntu/Canonical driven development should be targeting Python 3 right now, and all new code should be Python 3-only. If you can't do this because of your dependency stack, let's talk.

Python (last edited 2017-01-25 23:23:00 by localhost)