Difference between revisions of "Python package guidelines"

From ArchWiki
Jump to: navigation, search
(Examples: remove use arch=(i686 x86_64) for official repos)
(Examples: add return 1 (from Tokland in the Talk page))
Line 32: Line 32:
 
build() {
 
build() {
 
   cd $srcdir/$pkgname-$pkgver
 
   cd $srcdir/$pkgname-$pkgver
   python setup.py install --root=$pkgdir/
+
   python setup.py install --root=$pkgdir/ || return 1
  
 
   # Remember to install licenses if the license is not a common license!
 
   # Remember to install licenses if the license is not a common license!

Revision as of 03:57, 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/ || return 1

  # 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

-