aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-pytest-benchmark/APKBUILD
blob: 8ab40027805a26c74c687de372775ecd4ba6756c (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
# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-pytest-benchmark
_pkgname=pytest-benchmark
pkgver=3.2.3
pkgrel=0
pkgdesc="A pytest fixture for benchmarking code"
url="https://github.com/ionelmc/pytest-benchmark"
arch="noarch !mips !mips64" # blocked by py3-py-cpuinfo
license="BSD-2-Clause"
depends="python3 py3-pytest py3-py-cpuinfo"
makedepends="py3-setuptools"
checkdepends="py3-pytest-xdist py3-freezegun py3-pygal py3-elasticsearch"
source="$_pkgname-$pkgver.tar.gz::https://github.com/ionelmc/pytest-benchmark/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	python3 setup.py build
}

check() {
	# install the package to test_install directory for testing
	python3 setup.py install --root="$builddir"/test_install

	# disable three tests that require aspectlib (needs packaging)
	# last test fails when run inside a git repository, see: https://github.com/ionelmc/pytest-benchmark/issues/163
	PYTHONPATH="$builddir"/test_install/usr/lib/python3.8/site-packages PATH="$builddir"/test_install/usr/bin:"$PATH" \
		pytest -v tests \
		--deselect tests/test_with_testcase.py::TerribleTerribleWayToWritePatchTests::test_foo2 \
		--deselect tests/test_with_weaver.py::test_weave_fixture \
		--deselect tests/test_with_weaver.py::test_weave_method \
		--deselect tests/test_utils.py::test_parse_elasticsearch_storage
}

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

sha512sums="952dbe2a9af1ae5de966543eae3b4523a5418c8441785714cbb7a5d17697046f060befb4a40cf216526e2a9a63d91c598d65e65618bd78fc2d889c92cecbbe53  pytest-benchmark-3.2.3.tar.gz"