Added required tests, and fixed the issue related to ${PYTHON_PN} for Uvicorn.
Signed-off-by: Hugo FLEURY <fleuryhugo7@gmail.com>
---
.../python/python3-uvicorn/run-ptest | 6 +++
.../python/python3-uvicorn_0.34.2.bb | 37 +++++++++++++++++++
2 files changed, 43 insertions(+)
create mode 100644 meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
create mode 100644 meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
diff --git a/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest b/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
new file mode 100644
index 0000000000..d75b4cd4c9
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-uvicorn/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# based on the gunicorn ptest
+echo "nameserver 8.8.8.8" >> /etc/resolv.conf
+
+pytest
diff --git a/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb b/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
new file mode 100644
index 0000000000..cd2691a5ee
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-uvicorn_0.34.2.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Lightning-fast ASGI server implementation."
+HOMEPAGE = "https://www.uvicorn.org/"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.md;md5=5c778842f66a649636561c423c0eec2e"
+
+SRC_URI[sha256sum] = "0e929828f6186353a80b58ea719861d2629d766293b6d19baf086ba31d4f3328"
+
+inherit pypi python_hatchling python_setuptools_build_meta ptest
+
+SRC_URI += "file://run-ptest"
+
+RDEPENDS:${PN}-ptest += " \
+ python3-pytest \
+ python3-httptools \
+ python3-dotenv \
+ python3-httpx \
+ python3-pyyaml \
+ python3-websockets \
+ python3-a2wsgi \
+ python3-pytest-mock \
+"
+
+do_install_ptest() {
+ install -d ${D}${PTEST_PATH}/tests
+ cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+PYPI_PACKAGE = "uvicorn"
+
+RDEPENDS:${PN} += " \
+ python3-typing-extensions \
+ python3-click \
+ python3-h11 \
+ python3-anyio \
+"
+
+S = "${WORKDIR}/uvicorn-${PV}"
--
2.43.0