[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ A ] [ B ] [ next ]
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
pythonX.Y
. Names of related packages must
include the pythonX.Y
part.
For every Python version provided in the distribution, the package
pythonX.Y
shall comprise a complete
distribution for deployment of Python scripts and applications. The
package includes the binary
/usr/bin/pythonX.Y
and all modules of the
upstream Python distribution.
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
pythonX.Y-dev
. Documentation will be
provided separately as well.
At any time, the python
package must contain a symlink
/usr/bin/python
to the the appropriate binary
/usr/bin/pythonX.Y
. The python
package must also depend on the appropriate
pythonX.Y
to ensure this binary is
installed. The version of the 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 Main package, Section 1.2) 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 explicitely
use the versioned interpreter name
(pythonX.Y
).
The preferred specification for the Python interpreter is
/usr/bin/python
or
/usr/bin/pythonX.Y
. This ensures that a
Debian installation of python is used and all dependencies on additional python
modules are met.
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 pythonX.Y
.
However this is not advisable as it bypasses Debian's dependency checking and
makes the package vulnerable to incomplete local installations of python.
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/pythonX.Y.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 /usr/lib/pythonX.Y/site-packages/module-dir /usr/lib/site-python
Note that the use of the site-python directories in Python is depreciated. The directories might be dropped from the path in a future version.
The /usr/lib/pythonX.Y.zip archive appeared in python2.3.
TODO: in fact this directory was not deprecated at all, and is widely used for shipping modules for the default python version. It has been suggested to automatically bytecompile modules in this directory for the current python version, which is technically feasible and would make it a place of choice for version-independent python modules (e.g. for modules shipped with a single script).
TODO: What about /usr/share/pythonX.Y
? Wait
for upstream ... see http://python.org/sf/588756
.
Python documentation is split out in separate packages
pythonX.Y-doc
. The package
python-doc
will always provide the documentation for the default
Debian Python version.
TODO: Policy for documentation of third party packages.
[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ A ] [ B ] [ next ]
Debian Python Policy
version 0.3.7.2nas@debian.org
doko@debian.org
flight@debian.org
joss@debian.org