diff mbox series

[meta-python,3/3] python3-google-auth: add ptest and update runtime dependencies

Message ID 20240308055136.81476-3-alperyasinak1@gmail.com
State Accepted
Headers show
Series [meta-python,1/3] python3-pytest-localserver: added recipe which is also include ptest | expand

Commit Message

Alper Ak March 8, 2024, 5:51 a.m. UTC
* Generally we want to keep images as small as possible. RDEPENDS should not contains nothing except what is absolutely needed for a recipe.

* Tested on qemux86-64 and qemuarm64

* Add ptest into PTESTS_SLOW_META_PYTHON

Ptest results:
==============
qemux86-64:

Testsuite summary
TOTAL: 1074
PASS: 1074
SKIP: 0
XFAIL: 0
FAIL: 0
XPASS: 0
ERROR: 0
DURATION: 227
END: /usr/lib/python3-google-auth/ptest
2024-03-07T21:30
STOP: ptest-runner
TOTAL: 1 FAIL: 0

qemuarm64:

Testsuite summary
TOTAL: 1074
PASS: 1074
SKIP: 0
XFAIL: 0
FAIL: 0
XPASS: 0
ERROR: 0
DURATION: 184
END: /usr/lib/python3-google-auth/ptest
2024-03-07T21:15
STOP: ptest-runner
TOTAL: 1 FAIL: 0

Signed-off-by: alperak <alperyasinak1@gmail.com>
---
 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-google-auth/run-ptest      |  4 ++
 .../python/python3-google-auth_2.28.1.bb      | 43 +++++++++++++------
 3 files changed, 34 insertions(+), 14 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-google-auth/run-ptest
diff mbox series

Patch

diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index ce5ccf22d..63457189e 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -78,6 +78,7 @@  PTESTS_FAST_META_PYTHON = "\
 
 PTESTS_SLOW_META_PYTHON = "\
     python3-arrow \
+    python3-google-auth \
     python3-lz4 \
     python3-marshmallow \
     python3-pytest-localserver \
diff --git a/meta-python/recipes-devtools/python/python3-google-auth/run-ptest b/meta-python/recipes-devtools/python/python3-google-auth/run-ptest
new file mode 100644
index 000000000..f1c8729f0
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-google-auth/run-ptest
@@ -0,0 +1,4 @@ 
+#!/bin/sh
+
+pytest --automake
+
diff --git a/meta-python/recipes-devtools/python/python3-google-auth_2.28.1.bb b/meta-python/recipes-devtools/python/python3-google-auth_2.28.1.bb
index 4524cca48..1f37544d2 100644
--- a/meta-python/recipes-devtools/python/python3-google-auth_2.28.1.bb
+++ b/meta-python/recipes-devtools/python/python3-google-auth_2.28.1.bb
@@ -3,24 +3,39 @@  HOMEPAGE = "https://github.com/googleapis/google-auth-library-python"
 LICENSE = "Apache-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 
-inherit pypi setuptools3
+inherit pypi setuptools3 ptest
 
 SRC_URI[sha256sum] = "34fc3046c257cedcf1622fc4b31fc2be7923d9b4d44973d481125ecc50d83885"
 
-RDEPENDS:${PN} += "\
-    python3-asyncio \
-    python3-datetime \
-    python3-io \
-    python3-json \
-    python3-logging \
-    python3-netclient \
-    python3-numbers \
+SRC_URI += " \
+        file://run-ptest \
+"
+
+RDEPENDS:${PN}-ptest += " \
+        python3-cryptography \
+        python3-flask \
+        python3-freezegun \
+        python3-grpcio \
+        python3-mock \
+        python3-oauth2client \
+        python3-pyopenssl \
+        python3-pytest \
+        python3-pytest-localserver \
+        python3-pyu2f \
+        python3-requests \
+        python3-responses \
+        python3-unittest-automake-output \
+        python3-unixadmin \
 "
 
+do_install_ptest() {
+        install -d ${D}${PTEST_PATH}/tests
+        cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
 RDEPENDS:${PN} += "\
-    python3-aiohttp \
-    python3-cachetools \
-    python3-pyasn1-modules \
-    python3-rsa \
-    python3-six \
+        python3-cachetools \
+        python3-json \
+        python3-pyasn1-modules \
+        python3-rsa \
 "