aboutsummaryrefslogtreecommitdiffstats
path: root/community/pytest/APKBUILD
blob: 43c064bae58f4adff9724cd9473f792e1814a6a6 (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
# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=pytest
pkgver=3.0.6
pkgrel=1
pkgdesc="A python test library"
url="http://pytest.org"
arch="noarch"
license="MIT"
depends="py3-$pkgname"
makedepends="python2-dev py-setuptools python3-dev"
subpackages="py3-$pkgname:_py3 py2-$pkgname:_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 || return 1
	python3 setup.py build || return 1
}

package() {
	mkdir -p "$pkgdir"/usr/bin

	local name; for name in py.test pytest; do
		ln -s $name-3 "$pkgdir"/usr/bin/$name || return 1
	done
}

_py2() {
	replaces="$pkgname"
	depends="py2-py"
	_py python2
}

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

_py() {
	local python="$1"
	local pyver="${1:6:1}"
	pkgdesc="$pkgdesc (for $python)"
	depends="$depends $python"
	install_if="$pkgname=$pkgver-r$pkgrel $python"

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

	# Add version suffix to executable files.
	local path; for path in "$subpkgdir"/usr/bin/*; do
		mv "$path" "$path-$pyver" || return 1
	done
}

md5sums="6639592fa430567d024189f097fcdbd7  pytest-3.0.6.tar.gz"
sha256sums="643434a9f1a188271da35e20064cb8b6c5440976c5bb541dc7b5b0e3cf75d940  pytest-3.0.6.tar.gz"
sha512sums="0e983f1f52c18327537d20be30425f4c74037d1fbf6b4aedf2646cf21d450fa9b2b20625f26f5db759b4fe1fd28c6640cb1df88e667efaeea6642e7f02f01e06  pytest-3.0.6.tar.gz"