desktop/python-pytest/PKGBUILD
2015-09-18 23:52:25 +02:00

57 lines
1.7 KiB
Bash

pkgbase=python-pytest
pkgname=('python2-pytest' 'python3-pytest')
pkgver=2.7.3
pkgrel=1
pkgdesc="Simple powerful testing with Python"
arch=('any')
license=('MIT')
url="http://pytest.org/"
makedepends=('python2-setuptools' 'python3-setuptools' 'python2-py' 'python3-py')
checkdepends=('lsof' 'python3-nose' 'python2-nose' 'python3-twisted' 'python2-twisted' 'python3-mock' 'python2-mock' 'python3-yaml' 'python2-yaml' 'python3-pexpect' 'python2-pexpect')
source=("http://pypi.python.org/packages/source/p/pytest/pytest-$pkgver.tar.gz")
sha512sums=('ad9b57f202c60c247dd4753fb8391e3e88b390e34de678ea12384d81d76693dd37e04f11f6da19a6eda2c74a73db23789856ccaa325d32b4beb6bff86d9e4173')
prepare() {
cp -r pytest-${pkgver}{,-py3}
cp -r pytest-${pkgver}{,-py2}
}
build() {
cd "$srcdir/pytest-${pkgver}-py3"
python3 setup.py build
cd "$srcdir/pytest-${pkgver}-py2"
python2 setup.py build
}
check() {
cd "$srcdir/pytest-${pkgver}-py3"
python3 setup.py test
cd "$srcdir/pytest-${pkgver}-py2"
python2 setup.py test
}
package_python3-pytest() {
depends=('python3' 'python3-py' 'python3-setuptools')
cd pytest-${pkgver}-py3
python3 setup.py install --root="${pkgdir}" --optimize=1
install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
package_python2-pytest() {
depends=('python2' 'python2-py' 'python2-setuptools')
provides=('python-pytest' 'python2-pytest')
conflicts=('python-pytest')
replaces=('python-pytest')
cd pytest-${pkgver}-py2
python2 setup.py install --root="${pkgdir}" --optimize=1
install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
# deal with the conflict with python-pytests version of /usr/bin/py.test
mv "${pkgdir}/usr/bin/py.test" "${pkgdir}/usr/bin/py.test2"
}