Difference between revisions of "Python package guidelines"

From ArchWiki
Jump to: navigation, search
(minor formatting changes)
Line 6: Line 6:
  
 
== Package Naming ==
 
== Package Naming ==
For libraries, use {{Ic|python-''modulename''}}. For applications, use the program name. In either case, the name should be entirely lowercase.
+
For libraries, use {{Ic|python-''modulename''}}. For applications, use the program name. In either case, the package name should be entirely lowercase.
  
Python2 libraries should instead be named {{Ic|python2-''modulename''}}.
+
Python 2 libraries should instead be named {{Ic|python2-''modulename''}}.
  
 
== File Placement ==
 
== File Placement ==
Most python packages are installed with the [http://docs.python.org/library/distutils.html distutils] system using '''setup.py''', which places files under {{Ic|/usr/lib/python''<python version>''/site-packages/''pkgname''}} directory.
+
Most Python packages are installed with the [http://docs.python.org/library/distutils.html distutils] system using '''setup.py''', which installs files under {{Ic|/usr/lib/python''<python version>''/site-packages/''pkgname''}} directory.
  
 
== Notes ==
 
== Notes ==
Line 18: Line 18:
 
In most cases, you should put {{Ic|any}} in the {{Ic|arch}} array since most Python packages are architecture independent.
 
In most cases, you should put {{Ic|any}} in the {{Ic|arch}} array since most Python packages are architecture independent.
  
Please do not install a directory named just {{Ic|tests}}, as it easily conflicts with other python packages. (Like {{Ic|/usr/lib/python2.7/site-packages/tests/}})
+
Please do not install a directory named just {{Ic|tests}}, as it easily conflicts with other Python packages (for example, {{Ic|/usr/lib/python2.7/site-packages/tests/}}).
  
 
== Example ==
 
== Example ==
 
An example PKGBUILD can be found at {{Ic|/usr/share/pacman/PKGBUILD-python.proto}}, which is in the {{Pkg|abs}} package.
 
An example PKGBUILD can be found at {{Ic|/usr/share/pacman/PKGBUILD-python.proto}}, which is in the {{Pkg|abs}} package.

Revision as of 22:48, 2 July 2012

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 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 at /usr/share/pacman/PKGBUILD-python.proto, which is in the abs package.