Debian Python FAQ
- What are the projects and documentation available ?
- Multiple python versions support
- Note on bytecompilation for pure Python modules
- Python eggs
1. What are the projects and documentation available ?
If you're interested in help packaging Python itself, there's pkg-python but if you want to help with the Python modules or packaging a new one, you should look at Debian Python Modules Team project. Both groups discuss its activities in the same firstname.lastname@example.org mailing list.
2. Multiple python versions support
Debian supports several versions of Python simultaneously. Some packages include modules only for the default version, while others provide modules for all available. Source packages may provide several binary packages for each version of Python or build a single one that suits all.
The general trend is to reduce that diversity and provide modules for all Python versions available within Debian using the following guidelines.
2.1. Build dependencies
Traditionally, build dependencies for Python extension modules included development packages for all versions of Python they were built for. For compiled modules you still have to specify each dependency separately. For Python-only modules the sole python-dev is sufficient if they use Python-based build system (like the very used distutils), python-support dependency in turn will automagically manage late-bytecompilation.
3. Note on bytecompilation for pure Python modules
As python-support introduce late-bytecompilation, no .pyc/.pyo files shall be shipped in your package. You do no need to spend build time for generating them. With distutils use the "--no-compile -O0" options; if you are using the CDBS class, everything is already done for you. Beware some upstream sources that contain a setup.cfg which override your build options (see 360848), then you will have to patch it. In all cases, python-support will remove those files if they are generated.
3.1. What is python-support?
Python-support is a tool to handle byte-compilation of python modules when there are several python versions installed on the system.
See /usr/share/doc/python-support/README.gz or SVN README for up-to-date information.
3.2. What is python-central?
Package that contains some helper scripts for building and installing python modules independent of the current installed Python version.
Some information about python-central can be found here: http://python-modules.alioth.debian.org/python-central_howto.txt
3.3. Should I use python-support or python-central?
Most people prefer python-support, because it is better so use that.
Some statistics (the number of packages using each method), as of November 30, 2009:
~/python-modules$ grep python-support packages/*/trunk/debian/control | wc -l 279 ~/python-modules$ grep python-central packages/*/trunk/debian/control | wc -l 56
4. Python eggs
4.1. What are Python eggs?
4.2. How should we package Python eggs?
We don't want to provide ".egg" files within the .deb. However we want to make the "egg meta-information" available so that users can use eggs if they so wish. For that you need to pass the option "--single-version-externally-managed" to the "setup.py install" call.
Packages relying on CDBS can do that this way:
# Install egg-info directories DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed