summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/python-pytest-xdist/PKGBUILD
blob: 5fd48ca6f8114474d8e6ff80411870b9e6f9233b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgbase=python-pytest-xdist
pkgname=('python-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=('python-pytest' 'python2-pytest' 'python-setuptools_scm' 'python2-setuptools_scm'
             'python-execnet' 'python2-execnet' 'python-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
  python 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
  python 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_python-pytest-xdist() {
  depends=('python-pytest-forked' 'python-execnet')

  cd pytest-xdist-$pkgver
  python 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
}
# vim:set ts=2 sw=2 et: