Difference between revisions of "Python package guidelines"

From ArchWiki
Jump to: navigation, search
m (Blackx moved page Python Package Guidelines to Python package guidelines: renamed for consistency with other package guidelines (also titles should use sentence case, see Help:Style#Title))
(No difference)

Revision as of 07:34, 22 December 2014

Template:Package Guidelines This document covers standards and guidelines on writing PKGBUILDs for Python software.

Package naming

For Python 3 libraries, use python-modulename. For applications, use the program name. In either case, the package name should be entirely lowercase.

Python 2 libraries should instead be named python2-modulename.

Versioned packages

If you need to add a versioned package then use python-modulename-version, e.g. python-colorama-0.2.5. So python dependency colorama==0.2.5 will turn into python-colorama-0.2.5 Arch package.

File placement

Most Python packages are installed with the distutils system using setup.py, which installs files under /usr/lib/python<python version>/site-packages/pkgname directory.


The --optimize=1 parameter compiles .pyo files so they can be tracked by pacman.

In most cases, you should put any in the arch array since most Python packages are architecture independent.

Please do not install a directory named just tests, as it easily conflicts with other Python packages (for example, /usr/lib/python2.7/site-packages/tests/).


An example PKGBUILD can be found here or at /usr/share/pacman/PKGBUILD-python.proto, which is in the abs package.