Carl Smedstad pushed to branch main at Arch Linux / Packaging / Packages /
python-gammu
Commits:
7c951e61 by Carl Smedstad at 2024-08-20T19:35:13+02:00
upgpkg: 3.2.4-6: Improve test workaround
Rather than deleting the source package and running the test suite from the
project root, move the tests to the temporary installation and run the suite
from there.
- - - - -
2 changed files:
- .SRCINFO
- PKGBUILD
Changes:
=====================================
.SRCINFO
=====================================
@@ -1,7 +1,7 @@
pkgbase = python-gammu
pkgdesc = Python bindings for Gammu library
pkgver = 3.2.4
- pkgrel = 5
+ pkgrel = 6
url = https://wammu.eu/python-gammu/
arch = x86_64
license = GPL-2.0-or-later
=====================================
PKGBUILD
=====================================
@@ -4,7 +4,7 @@
pkgname=python-gammu
pkgver=3.2.4
-pkgrel=5
+pkgrel=6
pkgdesc="Python bindings for Gammu library"
arch=('x86_64')
url="https://wammu.eu/python-gammu/"
@@ -33,16 +33,15 @@ build() {
check() {
cd $pkgname
- # The test suite must run with the project root as CWD, but if doing so the
- # uncompiled package in the project root will take precedence over the
- # compiled package installed in tmp_install. Remove the uncompiled package to
- # resolve this.
- rm -r gammu
python -m installer --destdir=tmp_install dist/*.whl
local site_packages=$(python -c "import site;
print(site.getsitepackages()[0])")
- export PYTHONPATH="$PWD/tmp_install/$site_packages"
+ # The test suite cannot run in the project root as the uncompiled package
+ # there will take precedence over the compiled package installed in
+ # tmp_install, regardless of what PYTHONPATH is set to. To work around this,
+ # copy the tests to the tmp_install directory and run them from there.
+ cp -r test "$PWD/tmp_install/$site_packages"
# Tests can be flaky on slower hardware due to timing.
- python -m unittest discover -v
+ python -m unittest discover -vs "$PWD/tmp_install/$site_packages"
}
package() {
View it on GitLab:
https://gitlab.archlinux.org/archlinux/packaging/packages/python-gammu/-/commit/7c951e61df7c5c4987297c6bcfc25613ff1c5030
--
View it on GitLab:
https://gitlab.archlinux.org/archlinux/packaging/packages/python-gammu/-/commit/7c951e61df7c5c4987297c6bcfc25613ff1c5030
You're receiving this email because of your account on gitlab.archlinux.org.