Differences between revisions 15 and 18 (spanning 3 versions)
Revision 15 as of 2009-07-28 18:38:37
Size: 2925
Editor: ?techtonik
Comment: + more information for Python developers
Revision 18 as of 2009-12-14 21:48:12
Size: 2189
Comment: Remove some bits superseded by recent policy update
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
Within the Debian project the Python compiler/interpreter package is maintained by a developers team known as [[http://alioth.debian.org/projects/pkg-python|pkg-python]]. There are many Python modules and extensions maintained by individual developers and by a coordinated group called [[Teams/PythonModulesTeam|Debian Python Modules Team]]. The Debian project contains many other applications written in Python that are maintained by a separate [[Teams/PythonAppsPackagingTeam|Python Applications Packaging Team]]. Within the Debian project the Python compiler/interpreter package is maintained by a developers team known as [[http://alioth.debian.org/projects/pkg-python|pkg-python]]. Python modules and extensions are maintained by individual developers and by a coordinated group called [[Teams/PythonModulesTeam|Debian Python Modules Team]]. There are also Python applications that are maintained by a separate [[Teams/PythonAppsPackagingTeam|Python Applications Packaging Team]].
Line 24: Line 24:
Text of Debian Python Policy describes conventions for packaging and distributing Python code in Debian. The official text is located at http://www.debian.org/doc/packaging-manuals/python-policy/ Text of Debian Python Policy describes conventions for packaging and distributing Python code in Debian. The official text is located at http://www.debian.org/doc/packaging-manuals/python-policy/.
Line 26: Line 26:
The text is a primary reference, but it can be summarized as follows:
 * Debian installation may have multiple Python versions
 * Modules should be installed to /usr/lib/pythonX.Y/site-packages
 * Bytecompilation should occur in post installation step (postinst), bytecompiled files should be removed in prerm
 * /etc/python/debian_config has option to control byte compilation
 * ...

However, policy doesn't describe how all of the above should be done. It is assumed that Python developers should be familiar with Debian tools, but it is usually not a case. That's why the state of support of Python packages in Debian is not super and a separate tutorial would be really appreciated.
  
See DebianPython/NewPolicy for more information about how to convert old and non-confirming packages.
Feel free to ask any questions on debian-python@l.d.o mailing list and contribute to [[DebianPython/Tutorial]].

Python in Debian

Software written in the Python programming language is executed by Python interpreter and is usually compiled into platform independent bytecode files to increase performance. Thus software that written in pure Python can be distributed as source code or as compiled bytecode. The latter is similar to Java. Unfortunately, compiled bytecode files are incompatible from Python version to Python version. Certain Debian system may have several Python versions available, so to avoid distributing several packages for each version, Debian Policy makes sure that Python code is distributed in clear form and compiled only during installation process on target system. Python is able to compile and write bytecode *.pyc files alongside with *.py sources when *.py is executed, but insufficient permissions may not allow it to write in corresponding directories, so to avoid drop-down in performance compiling is done during installation.

The so-called C-Python interpreter is a software package containing both the compiler and the bytecode interpreter used to execute Python files. Within the Debian project the Python compiler/interpreter package is maintained by a developers team known as pkg-python. Python modules and extensions are maintained by individual developers and by a coordinated group called Debian Python Modules Team. There are also Python applications that are maintained by a separate Python Applications Packaging Team.

Supported Python Versions

Debian's latest release Lenny contains multiple Python versions: 2.5 (the default) and 2.4.

Debian Python Policy for Python developers

Text of Debian Python Policy describes conventions for packaging and distributing Python code in Debian. The official text is located at http://www.debian.org/doc/packaging-manuals/python-policy/.

Feel free to ask any questions on debian-python@l.d.o mailing list and contribute to ?DebianPython/Tutorial.

See also