desktop/python-pytest/PKGBUILD
2018-03-11 22:06:51 +00:00

66 lines
2.0 KiB
Bash

pkgbase=python-pytest
pkgname=('python2-pytest' 'python3-pytest')
pkgver=3.4.2
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'
'python2-pluggy' 'python3-pluggy'
'python2-attrs' 'python3-attrs'
'python2-funcsigs')
checkdepends=('lsof'
'python3-nose' 'python2-nose'
'python3-mock' 'python2-mock'
'python3-tox' 'python2-tox'
'python3-yaml' 'python2-yaml'
'python3-pytest-xdist' 'python2-pytest-xdist'
'python3-twisted' 'python2-twisted'
'python3-requests' 'python2-requests'
'python3-hypothesis' 'python2-hypothesis')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pytest-dev/pytest/archive/$pkgver.tar.gz")
sha512sums=('6765325353122ebfe1cc03798d64009ef05dbcaa9d8d5dfa6b9d63f8b81282e73c7e95cd17c7668f70f2cb50e222dbf93a31dc39947c1d2552a352fab7b192b3')
prepare() {
cp -a pytest-$pkgver{,-py2}
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}
build() {
cd "$srcdir"/pytest-$pkgver
python3 setup.py build
cd "$srcdir"/pytest-$pkgver-py2
python2 setup.py build
}
check() {
cd "$srcdir"/pytest-$pkgver
python3 setup.py test
cd "$srcdir"/pytest-$pkgver-py2
python2 setup.py test
}
package_python3-pytest() {
depends=('python3-py' 'python3-setuptools' 'python3-pluggy' 'python3-attrs')
cd pytest-$pkgver
python3 setup.py install --root="$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python2-pytest() {
depends=('python2-py' 'python2-setuptools' 'python2-pluggy' 'python2-attrs' 'python2-funcsigs')
cd pytest-$pkgver-py2
python2 setup.py install --root="$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
mv "$pkgdir"/usr/bin/py.test{,2}
mv "$pkgdir"/usr/bin/pytest{,2}
}