summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorredponike2025-04-14 03:31:51 +0200
committerredponike2025-04-14 03:31:51 +0200
commitf5298eac3ca9efa0fedf7068d408613c2b36db27 (patch)
treeface5ed8a3ce106f02dc32833de73bb76d78a111 /PKGBUILD
parent844b732f92f347a4b98d8637881f8e3ed1148391 (diff)
downloadaur-python-trubar.tar.gz
Switch to PEP 517 - Add tests - Install LICENSE file
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD26
1 files changed, 17 insertions, 9 deletions
diff --git a/PKGBUILD b/PKGBUILD
index dc8d0df41e70..ce12f7775691 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,23 +1,31 @@
-# Maintainer: redponike <proton (dot) me>
+# Maintainer: redponike
pkgname=python-trubar
+_pkgname=${pkgname#python-}
pkgver=0.3.4
-pkgrel=1
+pkgrel=2
pkgdesc="Translation and localization of Python programs via modification of source files."
-arch=('x86_64')
+arch=('any')
url="https://github.com/janezd/trubar"
license=('MIT')
-makedepends=('python-setuptools')
+makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
depends=('python-libcst' 'python-yaml')
-source=("${pkgname}-${pkgver}.tar.gz::https://github.com/janezd/trubar/archive/refs/tags/${pkgver}.tar.gz")
+checkdepends=('python-pytest')
+source=("${pkgname}-${pkgver}.tar.gz::$url/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('08f5351d8cf8a96ee5f14a6eb44405b91c3898af655bcee89aa4519eb1193696')
build() {
- cd "${srcdir}/trubar-$pkgver"
- python setup.py build
+ cd "${_pkgname}-${pkgver}"
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ cd "${_pkgname}-${pkgver}"
+ pytest -vv
}
package() {
- cd "${srcdir}/trubar-$pkgver"
- python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+ cd "${_pkgname}-${pkgver}"
+ python -m installer --destdir="${pkgdir}" dist/*.whl
+ install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}