author | Daniel M. Capella
<polyzen@archlinux.org> 2022-09-02 16:22:24 UTC |
committer | Daniel M. Capella
<polyzen@archlinux.org> 2022-09-02 16:22:24 UTC |
parent | e569d7c1d86c32fbffed001ffd186af3de738409 |
PKGBUILD | +11 | -6 |
diff --git a/PKGBUILD b/PKGBUILD index ded86eb..163428a 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -4,14 +4,14 @@ pkgname=python-pytest pkgver=7.1.2 -pkgrel=1 +pkgrel=2 pkgdesc="Simple powerful testing with Python" arch=('any') license=('MIT') url="https://pytest.org/" depends=('python-attrs' 'python-iniconfig' 'python-packaging' 'python-pluggy' 'python-py' 'python-tomli') -makedepends=('python-setuptools') +makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel') checkdepends=('python-argcomplete' 'python-hypothesis' 'python-mock' 'python-nose' 'python-requests' 'python-xmlschema' # Unlisted, but actually used. Check again after a while: @@ -33,18 +33,23 @@ prepare() { build() { cd pytest-$pkgver - python setup.py build + python -m build --wheel --skip-dependency-check --no-isolation } check() { cd pytest-$pkgver python -m venv --system-site-packages test-env - test-env/bin/python setup.py install --optimize=1 --skip-build + test-env/bin/python -m installer dist/*.whl test-env/bin/python -m pytest } package() { cd pytest-$pkgver - python setup.py install --root="$pkgdir" --optimize=1 - install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/ + python -m installer --destdir="$pkgdir" dist/*.whl + + # Symlink license file + local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + install -d "$pkgdir"/usr/share/licenses/$pkgname + ln -s "$site_packages"/pytest-$pkgver.dist-info/LICENSE \ + "$pkgdir"/usr/share/licenses/$pkgname/LICENSE }