Python package guidelines

From ArchWiki
Revision as of 03:55, 7 August 2009 by Abhidg (Talk | contribs) (Examples: remove use arch=(i686 x86_64) for official repos)

Jump to: navigation, search

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.

Automation

-