summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Fontenelle2024-04-23 16:50:02 -0300
committerRafael Fontenelle2024-04-23 16:50:02 -0300
commit2b0506fa11d0c11d813bae8c4750c135d45dc2f2 (patch)
tree4c172db5b5a3b3f7fa7c7a8ddbb6db2eabd71e31
parent18feff76097ff9504c353b484623c537ec06a02e (diff)
downloadaur-2b0506fa11d0c11d813bae8c4750c135d45dc2f2.tar.gz
Add check() function
-rw-r--r--.SRCINFO1
-rw-r--r--PKGBUILD9
2 files changed, 10 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6ddf6fcbf10b..2eb89b549264 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,6 +5,7 @@ pkgbase = pyg3t-git
url = https://gitlab.com/pyg3t/pyg3t
arch = any
license = GPL-3.0-or-later
+ checkdepends = python-pytest
makedepends = git
makedepends = python-setuptools
makedepends = python-build
diff --git a/PKGBUILD b/PKGBUILD
index b27031a09512..51af62789bb0 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -10,6 +10,7 @@ url="https://gitlab.com/pyg3t/pyg3t"
license=(GPL-3.0-or-later)
depends=(python)
makedepends=(git python-setuptools python-build python-installer python-wheel)
+checkdepends=(python-pytest)
provides=($_name)
conflicts=($_name)
source=(git+${url}.git)
@@ -28,6 +29,14 @@ build() {
python -m build --wheel --no-isolation
}
+# Workaround for the tests requiring installed scripts (poselect, etc.)
+check() {
+ cd $_name
+ python -m installer --destdir='tmp_dir' dist/*.whl
+ export PATH="$PWD/tmp_dir/usr/bin:$PATH"
+ PYTHONPATH=$PWD python -m pytest
+}
+
package() {
cd $_name
python -m installer --destdir="$pkgdir" dist/*.whl