Difference between revisions of "Python package guidelines"

From ArchWiki
Jump to: navigation, search
(Example: proto from ABS git)
(Added link to the “PKGBUILD Templates” page.)
Line 21: Line 21:
  
 
== Example ==
 
== Example ==
An example PKGBUILD can be found [https://projects.archlinux.org/abs.git/tree/prototypes/PKGBUILD-python.proto here] or at {{Ic|/usr/share/pacman/PKGBUILD-python.proto}}, which is in the {{Pkg|abs}} package.
+
An example PKGBUILD can be found [https://projects.archlinux.org/abs.git/tree/prototypes/PKGBUILD-python.proto here] or at {{Ic|/usr/share/pacman/PKGBUILD-python.proto}}, which is in the {{Pkg|abs}} package. Also you may want to check out [[PKGBUILD_Templates|PKGBUILD Templates]] page.

Revision as of 10:20, 3 January 2014

Template:Package Guidelines

Writing PKGBUILDs for software written in Python.

Package naming

For 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.

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.

Notes

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/).

Example

An example PKGBUILD can be found here or at /usr/share/pacman/PKGBUILD-python.proto, which is in the abs package. Also you may want to check out PKGBUILD Templates page.