Table of Contents
At any given time, the package python
will
represent the current default Debian Python version.
The default Debian Python version should alway be the latest stable upstream release that can be integrated in the distribution.
Apart from the default version, legacy versions of Python or beta versions of future releases may be included as well in the distribution, as long as they are needed by other packages, or as long as it seems reasonable to provide them. (Note: For the scope of this document, Python versions are synonymous to feature releases, i.e. Python 2.0 and 2.0.1 are subminor versions of the same Python version 2.0, but Python 2.1 and 2.2 are indeed different versions.)
For any version, the main package must be called
python
.
X
.Y
The set of currently supported python versions can be found
in /usr/share/python/debian_defaults
.
For every Python version provided in the distribution, the
package python
shall comprise a complete distribution for
deployment of Python scripts and applications. The
package includes the binary
X
.Y
/usr/bin/python
and
all modules of the upstream Python distribution.
X
.Y
Excluded are any modules that depend on
non-required packages, they will be provided in
separate packages. Some tools and files for the
development of Python modules are split off in a
separate package
python
.
Documentation will be provided separately as well.
X
.Y
-dev
At any time, the python
package must contain
a symlink /usr/bin/python
to the the appropriate binary
/usr/bin/python
. The
X
.Y
python
package must also depend on the
appropriate python
to ensure this binary is installed. The version of the
X
.Y
python
package must be greater than or equal to
X
.Y
and smaller than X
.Y+1
.
Python scripts depending on the default Python version (see Section 1.2, “Main package”) or not depending on a specific Python version should
use python
(unversioned) as the interpreter name.
Python scripts that only work with a specific Python version must
explicitly use the versioned interpreter name
(python
).
X
.Y
The preferred specification for the Python interpreter is
/usr/bin/python
or
/usr/bin/python
.
This ensures that a Debian installation of python is used
and all dependencies on additional python modules are met.
X
.Y
If a maintainer would like to provide the user with the
possibility to override the Debian Python interpreter, he
may want to use /usr/bin/env python
or
/usr/bin/env python
.
However this is not advisable as it bypasses Debian's dependency
checking and makes the package vulnerable to incomplete local
installations of python.
X
.Y
The module search path for Debian has been amended to include a directory tree in /usr/local at the beginning of the path. By default, sys.path is searched in the following order:
/usr/lib/pythonXY
.zip /usr/lib/pythonX
.Y
/usr/lib/pythonX
.Y
/plat-linux2 /usr/lib/pythonX
.Y
/lib-tk /usr/lib/pythonX
.Y
/lib-dynload /usr/local/lib/pythonX
.Y
/site-packages /usr/lib/pythonX
.Y
/site-packages /var/lib/python-support/pythonX
.Y
/usr/lib/pythonX
.Y
/site-packages/module-dir
/usr/lib/site-python
The use of the /usr/lib/site-python
directory
is deprecated. The directory may be dropped from the path in
a future version. The /usr/lib/pythonXY
.zip
archive appeared in python2.3; it is not currently used in
Debian. Modules should not install directly to the
/var/lib/python-support
directory; it is for
use by Section B.1, “python-support”.