desktop/python-pytest/PKGBUILD

55 lines
1.5 KiB
Bash
Raw Normal View History

pkgbase=python-pytest
pkgname=('python2-pytest' 'python3-pytest')
pkgver=2.9.0
pkgrel=1
pkgdesc="Simple powerful testing with Python"
2014-09-07 02:06:09 +08:00
arch=('any')
license=('MIT')
url="http://pytest.org/"
makedepends=('python2-setuptools' 'python3-setuptools' 'python2-py' 'python3-py')
2014-09-07 02:06:09 +08:00
checkdepends=('lsof' 'python3-nose' 'python2-nose' 'python3-twisted' 'python2-twisted' 'python3-mock' 'python2-mock' 'python3-yaml' 'python2-yaml' 'python3-pexpect' 'python2-pexpect')
source=("git+https://github.com/pytest-dev/pytest.git#tag=$pkgver")
sha512sums=('SKIP')
prepare() {
cp -a pytest{,-py2}
}
build() {
cd "$srcdir"/pytest
python setup.py build
cd "$srcdir"/pytest-py2
python2 setup.py build
}
2014-09-07 02:06:09 +08:00
check() {
cd "$srcdir"/pytest
# 1 xdist-related failure
python setup.py test || warning "Tests failed"
2014-09-07 02:06:09 +08:00
cd "$srcdir"/pytest-py2
# 1 xdist-related failure
python2 setup.py test || warning "Tests failed"
2014-09-07 02:06:09 +08:00
}
package_python3-pytest() {
depends=('python3' 'python3-py' 'python3-setuptools')
cd pytest
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')
cd pytest-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{,2}
}