Date: Saturday, February 4, 2023 @ 08:28:35 Author: grawlinson Revision: 1392314
addpkg: python-pyasn 1.6.1-3 Added: python-pyasn/ python-pyasn/repos/ python-pyasn/trunk/ python-pyasn/trunk/PKGBUILD ----------+ PKGBUILD | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) Added: python-pyasn/trunk/PKGBUILD =================================================================== --- python-pyasn/trunk/PKGBUILD (rev 0) +++ python-pyasn/trunk/PKGBUILD 2023-02-04 08:28:35 UTC (rev 1392314) @@ -0,0 +1,58 @@ +# Maintainer: George Rawlinson <[email protected]> + +pkgname=python-pyasn +pkgver=1.6.1 +pkgrel=3 +pkgdesc='Python IP address to Autonomous System Number lookup module' +arch=('x86_64') +url='https://github.com/hadiasghari/pyasn' +license=('MIT' 'BSD') # SPDX:BSD-4-Clause +# namcap complains about ordereddict, but this is only for Python 2 +# it also complains about urllib2, let's ignore that too +depends=( + 'python' + 'python-ujson' +) +makedepends=( + 'git' + 'python-build' + 'python-installer' + 'python-wheel' + 'python-setuptools' +) +checkdepends=('python-pytest') +_commit='1d64d6d2f20e0353b46fbf5b94f8bdea8f41e9ce' +source=("$pkgname::git+$url#commit=$_commit") +b2sums=('SKIP') + +pkgver() { + cd "$pkgname" + + git describe --tags | sed -e 's/^v//' -e 's/-re$//' +} + +build() { + cd "$pkgname" + + python -m build --wheel --no-isolation +} + +check() { + cd "$pkgname" + + # temporary install so pytest can pick up the compiled extension + python -m installer --destdir="$(pwd)/tmp" dist/*.whl + local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + export PYTHONPATH="$(pwd)/tmp/$site_packages" + + pytest -v +} + +package() { + cd "$pkgname" + + python -m installer --destdir="$pkgdir" dist/*.whl + + # license + install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE +}
