aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py-amqp/APKBUILD
blob: b9fa1f22164cbbb99bfd510b16e79d39aef4b19c (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
64
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=py-amqp
_pyname=amqp
pkgver=2.4.2
pkgrel=1
pkgdesc="an AMQP implementation"
url="https://pypi.python.org/pypi/amqp/"
arch="noarch"
license="BSD"
subpackages="py2-${pkgname#py-}:_py2 py3-${pkgname#py-}:_py3"
makedepends="python2 python3 py2-setuptools py3-setuptools"
checkdepends="
	py2-vine py3-vine py2-case py3-case py2-nose py3-nose py2-mock py3-mock
	py2-unittest2
"
_pypiprefix="${_pyname%${_pyname#?}}"
source="https://files.pythonhosted.org/packages/source/$_pypiprefix/$_pyname/$_pyname-$pkgver.tar.gz"
builddir=$srcdir/$_pyname-$pkgver
# requires a running rabbitmq sever, which is more complicated than it sounds
options="!check"

prepare() {
	cd "$builddir"
	sed -i requirements/test.txt -e 's/pytest-sugar.*//g'
	cp -r "$builddir" "$builddir"-py2
}

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

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

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

_py2() {
	cd "$builddir"-py2
	_py python2
}

_py3() {
	cd "$builddir"
	_py python3
	}

_py() {
	_python="$1"
	pkgdesc="$pkgdesc (for $_python)"
	depends="$depends $_python"
	install_if="$pkgname=$pkgver-r$pkgrel $_python"
	$_python setup.py install --prefix=/usr --root="$subpkgdir"
}

sha512sums="dba880c07ee8b503e02f11ea5804f559ac2eb85717118d796558b1890032482babd15930af78f9d11b77530d496fce3ba8c8579eec71ce5a3f76b8d8a181af34  amqp-2.4.2.tar.gz"