Difference between revisions of "Python package guidelines"

From ArchWiki
Jump to: navigation, search
m (removed Example PKGBUILD section)
(Package Naming: pick one convention (python-modulename))
Line 6: Line 6:
  
 
==Package Naming==
 
==Package Naming==
For libraries, use "python-modulename" or "pymodulename". For applications, use the program name. In either case, the pkgname should be entirely lowercase.
+
For libraries, use ''python-modulename''. For applications, use the program name. In either case, the pkgname should be entirely lowercase.
  
 
==Examples==
 
==Examples==

Revision as of 03:54, 7 August 2009

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Python package guidelines#)

Package Naming

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

Examples

Most python packages are installed using the distutils system using setup.py. An example PKGBUILD is shown below

# Contributor: Your Name <youremail@domain.com>

pkgname=python-foo
pkgver=VERSION
pkgrel=1
pkgdesc=""
arch=(any)
url=""
license=()
depends=('python')
makedepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=(!emptydirs)
install=

build() {
  cd $srcdir/$pkgname-$pkgver
  python setup.py install --root=$pkgdir/

  # Remember to install licenses if the license is not a common license!
  # install -D -m644 $srcdir/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
}

In most cases, you should put any in the arch array since most Python packages are architecture independent. However if you intend to upload to the official repositories then you should use arch=(i686 x86_64).

Automation

-