Table of Contents
This section describes the various tools to help package Python programs and modules for Debian. Although none of these tools are mandatory, their use is strongly encouraged, as the above policy has been designed with them in mind (and vice versa). This appendix is just an overview. If you use these tools, you should read their full documentation.
The python-support system provides a simple way to
bytecompile pure Python modules and manage dependencies. It
integrates with debhelper
. When using
python-support, you should install your modules
to /usr/share/python-support/
rather than the standard Python directories. python-support
will then handle compiling the modules and making
appropriate symbolic links for installed Python versions to
find them,
substitute package
${python:Depends}
, ${python:Versions}
,
and ${python:Provides}
in your control file, and
manage bytecompilation in your postinst/prerm.
To use it, call dh_pysupport
before dh_python
, and make sure you've
installed the modules in the right place:
PREFIX := debian/python-package/usr ... install: ... ./setup.py install --no-compile \ --install-lib=$(PREFIX)/share/python-support/python-package binary-indep: build install ... dh_pysupport dh_python ...
python-support can also manage private modules. To use this
feature, pass a list of directories to be managed by
python-support to dh_pysupport
and dh_python
. python-support cannot handle
compiled extensions.
python-central provides another way to manage Python
modules. It integrates with debhelper
,
but can also be used without it. When using python-central,
you should install your modules normally. It will then move
them to its private directory, and manage the same things
python-support does.
To use it, call dh_pycentral
before dh_python
:
install: ... ./setup.py install binary-indep: build install ... dh_pycentral dh_python ...
python-central can handle compiled extensions for multiple
Python versions. If you want python-central to handle
private modules, you must pass the list of directories
containing them to dh_python
(but
not dh_pycentral
).
If python-central should not move the files to its private
directory, useDH_PYCENTRAL=nomove dh_pycentral
instead.
Examples for source packages using python-central are pyenchant, python-imaging (modules and extensions), pyparallel (modules only).