Required changes for Python 2.6 transition

Luca Falavigna dktrkranz at
Wed May 27 21:53:27 BST 2009

... or "How to make Debian friends happy" :)

Python 2.6 landed in Ubuntu during Jaunty development cycle, but some
changes still have to be done to have packages in good shape with
latest Python version. Please note Karmic will only ship Python 2.6, so
Python-related packages must work with this version to be released.

== What Changed ==

Changes introduced have been heavily described and discussed, I list
some useful bits for those who missed them:

== Use (and abuse) of --install-layout=deb ==

One of the changes introduced by Python 2.6 was new default
installation path (/usr/local). In order to avoid .deb packages to
install files in /usr/local, recent Ubuntu Python packages introduced
--install-layout=deb option to install files under /usr (to comply with
Debian and FSH policies).

If a package uses distutils, yoy should consider to pass such option to
" install" call if you see files are installed under /usr/local
(on Ubuntu buildds, you will get a FTBFS because of pkgbinarymangler).
If you do so, remember to bump python* build-dependencies to at least
2.5.3-0ubuntu1 (for python2.5* build-depedencies) or 2.6.1-1ubuntu2
(for python2.6* ones).

Also note that if a package uses python-support to byte-compile Python
files and it only installs Python packages and no additional elements
(using data_files, for instance), recent python-support (>= 0.90.5,
Karmic has it already) is able to install files under /usr
automatically, so you only need to request a give-back to any MOTU or
Core-dev (and eventually asking Debian maintainer to bump pysupport
build-dependency to at least 0.90.5), no package upload is required. By
the way, be sure to give package a test build before taking action!

== Use of /usr/share/python/ ==

Recent python-defaults package (2.5.4-0ubuntu5 in Ubuntu and 2.5.4-1 in
Debian) added /usr/share/python/ file, which defines several
macros to help with Python 2.6 transition (especially for site-packages
=> dist-packages change). If you add it to debian/rules file, be sure
to bump python dependencies to be at least 2.5.4-0ubuntu5 (and
eventually asking Debian maintainer to bump it to be at least 2.5.4-1~).

== Avoid unnecessary build-dependencies bump ==

Bump build-dependencies as explained above is a good practice and
avoids backporters additional work to understand build failures in
backport requests. Please do not adjust other build-dependencies than
the ones mentioned above in the situations described, let the other
ones listed at to Debian
maintainers because it is a unneeded delta for Ubuntu.

== Code changes ==

If you face build failures related to Python 2.6 changes, please do not
use code hacks but read and follow advices listed at instead. A code hack could be
worse than a build failure, so pay attention when doing such a change.
Also, do not disable tests just to fix build failures, work on real
problems and let the tests do their job: checking if you did it right!

== Collaboration with Debian ==

Debian currently has Python 2.6 in experimental, it will be probably
moved to unstable soon, so they like good patches from Ubuntu. If you
have patches, suggestions, or simply need an advice on how to proceed,
just join #debian-python (network and drop a line, you
will find someone ready to help you to integrate your code into SVN
repository, upload fixed packages to be synced in Karmic or answer your
questions. If you didn't do it already, please send your Python-related
patches to Debian BTS (severity wishlist as long as Python 2.6 is in
experimental) to inform maintainers about upcoming changes.

Having changes included in Debian is quite simpler these days. PAPT
( and DPMT
( teams are willing to
review changes and sponsor them in Debian, packages can then be synced
directly instead of adding several unwanted divergences.

 . ''`.      Luca Falavigna
 : :'  :  Ubuntu MOTU Developer
 `. `'`     Debian Maintainer
   `-      GPG Key: 0x86BC2A50
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : 

More information about the ubuntu-devel mailing list