2014-04-13 23:15:48 +08:00
|
|
|
pkgbase=python-pytest
|
|
|
|
pkgname=('python2-pytest' 'python3-pytest')
|
2016-03-17 05:36:13 +08:00
|
|
|
pkgver=2.9.0
|
2014-04-13 23:15:48 +08:00
|
|
|
pkgrel=1
|
|
|
|
pkgdesc="Simple powerful testing with Python"
|
2014-09-07 02:06:09 +08:00
|
|
|
arch=('any')
|
2014-04-13 23:15:48 +08:00
|
|
|
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')
|
2016-03-17 05:36:13 +08:00
|
|
|
source=("git+https://github.com/pytest-dev/pytest.git#tag=$pkgver")
|
|
|
|
sha512sums=('SKIP')
|
2014-04-13 23:15:48 +08:00
|
|
|
|
|
|
|
prepare() {
|
2016-03-17 05:36:13 +08:00
|
|
|
cp -a pytest{,-py2}
|
2014-04-13 23:15:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2016-03-17 05:36:13 +08:00
|
|
|
cd "$srcdir"/pytest
|
|
|
|
python setup.py build
|
2014-04-13 23:15:48 +08:00
|
|
|
|
2016-03-17 05:36:13 +08:00
|
|
|
cd "$srcdir"/pytest-py2
|
2014-04-13 23:15:48 +08:00
|
|
|
python2 setup.py build
|
|
|
|
}
|
|
|
|
|
2014-09-07 02:06:09 +08:00
|
|
|
check() {
|
2016-03-17 05:36:13 +08:00
|
|
|
cd "$srcdir"/pytest
|
|
|
|
# 1 xdist-related failure
|
|
|
|
python setup.py test || warning "Tests failed"
|
2014-09-07 02:06:09 +08:00
|
|
|
|
2016-03-17 05:36:13 +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
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-04-13 23:15:48 +08:00
|
|
|
package_python3-pytest() {
|
|
|
|
depends=('python3' 'python3-py' 'python3-setuptools')
|
|
|
|
|
2016-03-17 05:36:13 +08:00
|
|
|
cd pytest
|
2014-04-13 23:15:48 +08:00
|
|
|
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')
|
|
|
|
|
2016-03-17 05:36:13 +08:00
|
|
|
cd pytest-py2
|
2014-04-13 23:15:48 +08:00
|
|
|
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
|
2016-03-17 05:36:13 +08:00
|
|
|
mv "$pkgdir"/usr/bin/py.test{,2}
|
2014-04-13 23:15:48 +08:00
|
|
|
}
|