python2.6 related changes

Matthias Klose doko at ubuntu.com
Fri Feb 20 16:00:14 GMT 2009


python2.6 is now in the archive and is added as a supported python version,
python2.4 is dropped as a supported python version.

Starting with python2.6, the default installation points to
/usr/local/lib/pythonX.Y/dist-packages, while files for packages included in the
distribution are found in /usr/lib/pythonX.Y/dist-packages. This is to avoid
overwriting files installed by local admins/users.  The python packaging helpers
are modified to do the right thing with files in these locations; for new
packages please add for distutils based installations (setup.py --install) the
extra option --install-layout=deb. This option is recognized for python2.4 and
python2.5 as well, and ignored.

The option to create the symlinks from sys.path to the shared area in the
preinst is removed (to shorten the non-availability of a module during the
installation). Instead dh_pycentral can now include the symlinks directly into
the package (use DH_PYCENTRAL=include-links dh_pycentral).

The pkgbinarymangler is modified to reject files located in
/usr/lib/pythonX.Y/site-packages.

Please assign bug reports caused by build failures to me.

  Matthias

Details:

Local installation path
-----------------------

When installing Python modules using distutils, the resulting files
end up in the same location wether they are installed by a Debian
package, or by a local user or administrator, unless the installation
path is overwritten on the command line.  Compare this with most
software based on autoconf, where an explicit prefix has to be
provided for the packaging, while the default install installs into
/usr/local.  For new Python versions packaged in Debian this will
change so that an installation into /usr (not /usr/local) requires an
extra option to distutils install command (--install-layout=deb).  To
avoid breaking the packaging of existing code the distutils install
command for 2.4 and 2.5 will just accept this option and ignore it.
For the majority of packages we won't see changes in the packaging,
provided that the python packaging helpers can find the files in the
right location and move it to the expected target path.

A second issue raised by developers was the clash of modules and
extensions installed by a local python installation (with default
prefix /usr/local) with the modules provided by Debian packages
(/usr/local/lib/pythonX.Y/site-packages shared by the patched "system"
python and the locally installed python.  To avoid this clash the
directory `site-packages' should be renamed to `dist-packages' in
both locations:

 - /usr/lib/pythonX.Y/dist-packages (installation location for code
   packaged for Debian)
 - /usr/local/lib/pythonX.Y/dist-packages (installation location
   for locally installed code using distutils install without
   options).

The path /usr/lib/pythonX.Y/site-packages is not found on sys.path
anymore.

About the name: Discussed this with Barry Warsaw and Martin v. Loewis,
and we came to the conclusion that using the same directory name for
both locations would be the most consistent way.

This change should make the request to conditionalize the inclusion of
/usr/local/lib/pythonX.Y/site-packages into sys.path obsolete.

If needed we can provide a symlink /usr/lib/pythonX.Y/site-packages
pointing to dist-packages.



More information about the ubuntu-devel mailing list