PKGBUILD 2.09 KB
Newer Older
1 2
pkgbase=python-pytest
pkgname=('python2-pytest' 'python3-pytest')
3
pkgver=5.4.0
4 5
pkgrel=1
pkgdesc="Simple powerful testing with Python"
6
arch=('x86_64')
7 8
license=('MIT')
url="http://pytest.org/"
9 10 11 12 13 14 15 16 17 18 19 20 21
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'
22 23
              'python3-hypothesis'   'python2-hypothesis'
              'python3-pluggy'       'python2-pluggy')
AlmAck's avatar
AlmAck committed
24
source=("$pkgbase-$pkgver.tar.gz::https://github.com/pytest-dev/pytest/archive/$pkgver.tar.gz")
25
sha512sums=('1042f537e73752257ed982470f4abd09e1b7031c5c4b428a319684008dac136ac68a2fb8b663140b2e312dff737bf178438d3c122e800f07bd10233417f73a57')
26 27

prepare() {
AlmAck's avatar
AlmAck committed
28 29 30
  cp -a pytest-$pkgver{,-py2}

  export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
31 32 33
}

build() {
AlmAck's avatar
AlmAck committed
34 35
  cd "$srcdir"/pytest-$pkgver
  python3 setup.py build
36

AlmAck's avatar
AlmAck committed
37
  cd "$srcdir"/pytest-$pkgver-py2
38 39 40
  python2 setup.py build
}

Ram-Z's avatar
Ram-Z committed
41 42 43 44
check() {
  cd "$srcdir"/pytest-$pkgver
  python3 setup.py test

45 46
#  cd "$srcdir"/pytest-$pkgver-py2
#  python2 setup.py test
Ram-Z's avatar
Ram-Z committed
47
}
Xuetian Weng's avatar
Xuetian Weng committed
48

49
package_python3-pytest() {
50
  depends=('python3-py' 'python3-setuptools' 'python3-pluggy' 'python3-attrs')
51

AlmAck's avatar
AlmAck committed
52 53 54
  cd pytest-$pkgver
  python3 setup.py install --root="$pkgdir" --optimize=1
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
55 56 57
}

package_python2-pytest() {
58
  depends=('python2-py' 'python2-setuptools' 'python2-pluggy' 'python2-attrs' 'python2-funcsigs')
59

AlmAck's avatar
AlmAck committed
60 61 62
  cd pytest-$pkgver-py2
  python2 setup.py install --root="$pkgdir" --optimize=1
  install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
63

AlmAck's avatar
AlmAck committed
64
  mv "$pkgdir"/usr/bin/py.test{,2}
AlmAck's avatar
AlmAck committed
65
  mv "$pkgdir"/usr/bin/pytest{,2}
66
}