summaryrefslogtreecommitdiffstats
path: root/abs/core/python_modules/python-pytest/PKGBUILD
blob: 0a9faed8bbe0cf02ad6ff6f028a6245f771ea476 (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
59
60
61
62
63
# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Felix Kaiser <felix.kaiser@fxkr.net>

pkgbase=python-pytest
pkgname=('python-pytest' 'python2-pytest')
pkgver=3.5.0
pkgrel=1
pkgdesc="Simple powerful testing with Python"
arch=('any')
license=('MIT')
url="http://pytest.org/"
makedepends=('python-setuptools' 'python2-setuptools' 'python-py' 'python2-py' 'python-pluggy'
             'python2-pluggy' 'python-attrs' 'python2-attrs' 'python-more-itertools'
             'python2-more-itertools' 'python2-funcsigs')
checkdepends=('lsof' 'python-nose' 'python2-nose' 'python-mock' 'python2-mock' 'python-tox'
              'python2-tox' 'python-yaml' 'python2-yaml' 'python-pytest-xdist'
              'python2-pytest-xdist' 'python-twisted' 'python2-twisted' 'python-requests'
              'python2-requests' 'python-hypothesis' 'python2-hypothesis')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pytest-dev/pytest/archive/$pkgver.tar.gz")
sha512sums=('3e67f411b45f0cce6921d65926b3c6b7bcf6169a8e96eb8f74465d795a49d690c7027db3cb3147868ce238d5b416a6e87de27728598e4a526bf6bbb7a5506913')

prepare() {
  cp -a pytest-$pkgver{,-py2}

  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}

build() {
  cd "$srcdir"/pytest-$pkgver
  python setup.py build

  cd "$srcdir"/pytest-$pkgver-py2
  python2 setup.py build
}

check() {
  cd "$srcdir"/pytest-$pkgver
  python setup.py test

  cd "$srcdir"/pytest-$pkgver-py2
  python2 setup.py test
}

package_python-pytest() {
  depends=('python-py' 'python-setuptools' 'python-pluggy' 'python-attrs' 'python-more-itertools')

  cd pytest-$pkgver
  python 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-more-itertools' '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}
}