aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralperak <alperyasinak1@gmail.com>2024-03-08 22:21:03 +0300
committerKhem Raj <raj.khem@gmail.com>2024-03-09 12:35:15 -0800
commit75d5263f306becb597a50849a43255df837d089e (patch)
tree7d9e8c592f0332ef45766871cace9fe35fa4f31b
parent578071e46fb4157d4f763a200311d345ca450160 (diff)
downloadmeta-openembedded-contrib-75d5263f306becb597a50849a43255df837d089e.tar.gz
python3-a2wsgi: added recipe which is also include ptest
Pure Python and only depend on the standard library. Compared with other converters, the advantage is that a2wsgi will not accumulate the requested content or response content in the memory, so you don't have to worry about the memory limit caused by a2wsgi. This problem exists in converters implemented by uvicorn/startlette or hypercorn. * Ptest and library example tested on qemux86-64 and qemuarm64 * Add ptest into PTESTS_FAST_META_PYTHON Ptest result: ============== qemux86-64: Testsuite summary TOTAL: 15 PASS: 15 SKIP: 0 XFAIL: 0 FAIL: 0 XPASS: 0 ERROR: 0 DURATION: 22 END: /usr/lib/python3-a2wsgi/ptest 2024-03-08T18:58 STOP: ptest-runner TOTAL: 1 FAIL: 0 qemuarm64: Testsuite summary TOTAL: 15 PASS: 15 SKIP: 0 XFAIL: 0 FAIL: 0 XPASS: 0 ERROR: 0 DURATION: 22 END: /usr/lib/python3-a2wsgi/ptest 2024-03-08T19:05 STOP: ptest-runner TOTAL: 1 FAIL: 0 Signed-off-by: alperak <alperyasinak1@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-python/conf/include/ptest-packagelists-meta-python.inc1
-rw-r--r--meta-python/recipes-devtools/python/python3-a2wsgi/run-ptest3
-rw-r--r--meta-python/recipes-devtools/python/python3-a2wsgi_1.10.2.bb33
3 files changed, 37 insertions, 0 deletions
diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index 63457189e2..acfe28039c 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -7,6 +7,7 @@
#
# ptests which take less than ~30s each
PTESTS_FAST_META_PYTHON = "\
+ python3-a2wsgi \
python3-appdirs \
python3-ansicolors \
python3-asgiref \
diff --git a/meta-python/recipes-devtools/python/python3-a2wsgi/run-ptest b/meta-python/recipes-devtools/python/python3-a2wsgi/run-ptest
new file mode 100644
index 0000000000..8d2017d39c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-a2wsgi/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-a2wsgi_1.10.2.bb b/meta-python/recipes-devtools/python/python3-a2wsgi_1.10.2.bb
new file mode 100644
index 0000000000..4d24c4517e
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-a2wsgi_1.10.2.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Convert WSGI app to ASGI app or ASGI app to WSGI app."
+HOMEPAGE = "https://github.com/abersheeran/a2wsgi"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e10d05d29ec6d8be8bfc503683f1bc9a"
+
+inherit pypi python_setuptools_build_meta ptest
+
+SRC_URI[sha256sum] = "46b2ca427cf9ad538c145e32eb36857e1cbf477b72fe1ed0e3d35e98c06061b9"
+
+DEPENDS += " \
+ python3-pdm-native \
+ python3-pdm-backend-native \
+"
+
+SRC_URI += " \
+ file://run-ptest \
+"
+
+RDEPENDS:${PN}-ptest += " \
+ python3-httpx \
+ python3-pytest \
+ python3-pytest-asyncio \
+ python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+RDEPENDS:${PN} += " \
+ python3-asyncio \
+"