1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 18:55:29 +03:00
aports/community/py3-pytest-benchmark/APKBUILD
2021-04-18 20:51:22 +02:00

41 lines
1.7 KiB
Text

# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-pytest-benchmark
_pkgname=pytest-benchmark
pkgver=3.4.1
pkgrel=0
pkgdesc="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="https://github.com/ionelmc/pytest-benchmark/archive/v$pkgver/pytest-benchmark-$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
local sitedir=$(python3 -c "import site; print(site.getsitepackages()[0])")
PYTHONPATH="$builddir"/test_install/"$sitedir" 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 \
--deselect tests/test_cli.py::test_help_compare
}
package() {
python3 setup.py install --prefix=/usr --root="$pkgdir" --skip-build
}
sha512sums="54fb5e3a176578b3c8f339878c7a9d047a0785befcbba42bb68c34b4b636d9b6f6a2097b36c5eefbbcf1a91f943bdae762c7978a0dba1af53514052f513ef4c5 pytest-benchmark-3.4.1.tar.gz"