# Contributor: Bart Ribbers # Maintainer: Bart Ribbers pkgname=py3-random2 pkgver=1.0.2 pkgrel=0 pkgdesc="Python 3 compatible Python 2 random Module" url="https://pypi.org/project/random2/" arch="noarch" license="PSF-2.0" depends="python3" makedepends="py3-setuptools py3-gpep517 py3-wheel" subpackages="$pkgname-pyc" source="https://pypi.python.org/packages/source/r/random2/random2-$pkgver.tar.gz fix-tests.patch " builddir="$srcdir/random2-$pkgver" prepare() { default_prepare # Remove a test that is invalid as of python 3.9 # Taken from Fedora .spec # https://src.fedoraproject.org/rpms/python-random2/blob/rawhide/f/python-random2.spec sed -i '/self\.gen\.getrandbits, 0/d' src/tests.py } build() { gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 >&2 } check() { python3 -m venv --clear --without-pip --system-site-packages .testenv .testenv/bin/python3 -m installer .dist/*.whl .testenv/bin/python3 -m unittest src/tests.py } package() { python3 -m installer -d "$pkgdir" .dist/*.whl } sha512sums=" 69b91de23ae2f384bf0054bd8e2bf36de0778b006d7c4620dd34b86297f021f80670c550069086f3c123cc47126e41449323de4944a31754c9d830eb08ab7db0 random2-1.0.2.tar.gz 34b07889afdee11835bdde9ac34bf04b09b7dc0a8b3587c5c4ef60b9378f6b07450dfbaa17d3f1be26f5d5503426ae997bd9b5069525e4acde483d67976fe352 fix-tests.patch "