[arch-commits] Commit in python-python-pkcs11/trunk (PKGBUILD)

Jonas Witschel diabonas at gemini.archlinux.org
Wed Apr 27 20:03:26 UTC 2022


    Date: Wednesday, April 27, 2022 @ 20:03:26
  Author: diabonas
Revision: 1191298

python-python-pkcs11: improve pytest setup for compiled C extension

Instead of copying the generated files, --import-mode=append can be used in
combination with setting PYTHONPATH to the build directory.

Modified:
  python-python-pkcs11/trunk/PKGBUILD

----------+
 PKGBUILD |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-04-27 19:56:40 UTC (rev 1191297)
+++ PKGBUILD	2022-04-27 20:03:26 UTC (rev 1191298)
@@ -38,8 +38,8 @@
 	export PKCS11_TOKEN_LABEL=TEST
 	export PKCS11_TOKEN_PIN=1234
 	export PKCS11_TOKEN_SO_PIN=5678
-	cp build/lib.*/pkcs11/*.so pkcs11
-	pytest
+	local _python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
+	PYTHONPATH="$PWD/build/lib.linux-$CARCH-$_python_version" pytest --import-mode=append
 }
 
 package() {



More information about the arch-commits mailing list