aboutsummaryrefslogtreecommitdiffstats
path: root/testing/pytest-mock/APKBUILD
blob: c33f8d351a38a2954a609d9c3d9adc9f04c6244e (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
# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=pytest-mock
_pkgname=${pkgname#py-}
pkgver=1.10.0
pkgrel=0
pkgdesc="Thin-wrapper around the mock package for easier use with py.test"
url="https://github.com/pytest-dev/pytest-mock"
arch="noarch"
license="MIT"
depends="pytest"
makedepends="python2-dev python3-dev py-setuptools"
subpackages="py3-${pkgname/py-/}:_py3 py2-${pkgname/py-/}:_py2"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

check() {
	cd "$builddir"
	python2 setup.py test
	python3 setup.py test
}

package() {
	mkdir -p "$pkgdir"
}

_py() {
	local python=$1
	pkgdesc="$pkgdesc - $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

	cd "$builddir"
	$python setup.py install --prefix=/usr --root="$subpkgdir"
}

_py2() {
	depends="py2-${depends//py-/py2-} py2-mock"
	_py python2
}

_py3() {
	depends="py3-${depends//py-/py3-}"
	_py python3
}

sha512sums="b8afba13da3e598b6493459298e395c0ecc06538733916659191bd5c5c22f40b0e296853ad940c16a6d492fcf46b2daf490ee589661d391e2c7cd1deb84da756  pytest-mock-1.10.0.tar.gz"