desktop/python-pytest-xdist/PKGBUILD

55 lines
1.8 KiB
Bash

pkgbase=python-pytest-xdist
pkgname=('python3-pytest-xdist' 'python2-pytest-xdist')
pkgver=1.22.2
pkgrel=1
pkgdesc='py.test xdist plugin for distributed testing and loop-on-failing modes'
arch=('any')
license=('MIT')
url='https://bitbucket.org/pytest-dev/pytest-xdist'
makedepends=('python3-pytest' 'python2-pytest' 'python3-setuptools-scm' 'python2-setuptools-scm'
'python3-execnet' 'python2-execnet' 'python3-pytest-forked' 'python2-pytest-forked')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pytest-dev/pytest-xdist/archive/v$pkgver.tar.gz")
sha512sums=('22de52876bdbcfdeb5ee14d4159ed8535d3f3afa1c2d67116f4d249cced24627163b34f3e1629b2198eb6f5672e4a7db7c864f6e45a37759be01ab2753a20dce')
prepare() {
cp -a pytest-xdist-$pkgver{,-py2}
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}
build() {
cd "$srcdir"/pytest-xdist-$pkgver
python3 setup.py build
cd "$srcdir"/pytest-xdist-$pkgver-py2
python2 setup.py build
}
check() {
# Hack entry points by installing it
cd "$srcdir"/pytest-xdist-$pkgver
python3 setup.py install --root="$PWD/tmp_install" --optimize=1
PYTHONPATH="$PWD/tmp_install/usr/lib/python3.6/site-packages:$PYTHONPATH" py.test
cd "$srcdir"/pytest-xdist-$pkgver-py2
python2 setup.py install --root="$PWD/tmp_install" --optimize=1
PYTHONPATH="$PWD/tmp_install/usr/lib/python2.7/site-packages:$PYTHONPATH" py.test2
}
package_python3-pytest-xdist() {
depends=('python3-pytest-forked' 'python3-execnet')
cd pytest-xdist-$pkgver
python3 setup.py install --root="$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
package_python2-pytest-xdist() {
depends=('python2-pytest-forked' 'python2-execnet')
cd pytest-xdist-$pkgver-py2
python2 setup.py install --root="$pkgdir" --optimize=1
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}