desktop/python-pycontracts/PKGBUILD

52 lines
1.5 KiB
Bash

# $Id: PKGBUILD 140810 2015-09-19 13:17:30Z fyan $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
pkgbase=python-pycontracts
pkgname=(python3-pycontracts python2-pycontracts)
pkgver=1.8.2
pkgrel=1
pkgdesc='Declare constraints on function parameters and return values'
arch=('any')
url="https://andreacensi.github.io/contracts"
license=('GPL')
makedepends=('python3-setuptools' 'python2-setuptools' 'python3-pyparsing' 'python2-pyparsing'
'python3-decorator' 'python2-decorator' 'python3-six' 'python2-six')
checkdepends=('python3-nose' 'python2-nose')
source=("https://pypi.io/packages/source/P/PyContracts/PyContracts-$pkgver.tar.gz")
sha512sums=('3ab81218fdb487b0f2e80db92de8ace91832a2aaeb8703f0eab2928338d5d7bc71d55f585b942be8d0c1e04d3602f6d754a307aca6d9e758c6d1fe5a361fc18e')
prepare() {
cp -a PyContracts-$pkgver{,-py2}
}
build() {
cd "$srcdir"/PyContracts-$pkgver
python3 setup.py build
cd "$srcdir"/PyContracts-$pkgver-py2
python2 setup.py build
}
check() {
cd "$srcdir"/PyContracts-$pkgver
python3 setup.py nosetests
cd "$srcdir"/PyContracts-$pkgver-py2
rm -r src/contracts-py3k-test
python2 setup.py nosetests
}
package_python3-pycontracts() {
depends=('python3-pyparsing' 'python3-decorator' 'python3-six')
cd PyContracts-$pkgver
python3 setup.py install --root="$pkgdir" --optimize=1
}
package_python2-pycontracts() {
depends=('python2-pyparsing' 'python2-decorator' 'python2-six')
cd PyContracts-$pkgver-py2
python2 setup.py install --root="$pkgdir" --optimize=1
}