aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-hypothesis/APKBUILD
blob: 02bbd198a41992bde76cad4be48d197ff0fd4b49 (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
# Contributor: Drew DeVault <sir@cmpwn.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=py3-hypothesis
pkgver=4.55.1
pkgrel=0
pkgdesc="Advanced property-based (QuickCheck-like) testing for Python"
url="https://hypothesis.works/"
arch="noarch"
license="MPL-2.0"
depends="py3-attrs py3-sortedcontainers"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-coverage py3-tz py3-numpy py3-dateutil py3-pexpect"
source="py-hypothesis-$pkgver.tar.gz::https://github.com/HypothesisWorks/hypothesis-python/archive/hypothesis-python-$pkgver.tar.gz
	"
builddir="$srcdir/hypothesis-hypothesis-python-$pkgver/hypothesis-python"

replaces="py-hypothesis" # Backwards compatibility
provides="py-hypothesis=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	# In python3 mock is actually unittest.mock
	sed -e 's/from mock/from unittest.mock/' -i tests/cover/test_regressions.py
	sed -e 's/from mock/from unittest.mock/' -i tests/cover/test_reflection.py

	# Add variables that will be used by python to find the local
	# hypothesis build
	PYPATH="$PWD/build/lib"

	# PYTHONPATH="$PYPATH" python3 -m pytest tests/cover
	PYTHONPATH="$PYPATH" python3 -m pytest tests/py3
	PYTHONPATH="$PYPATH" python3 -m pytest tests/datetime
	PYTHONPATH="$PYPATH" python3 -m pytest tests/numpy
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="d079bcfce6a37ebf245288d9c615fd0328daa90d81d3dd51a38d351fef4a9da5a79c6abcb63a4f39a71240ae82c5af122f6b01c482225e81889e8474068d6c1a  py-hypothesis-4.55.1.tar.gz"