Skip to contentSkip to conversation

python3-pytest-timeout: Add runtime dependencies

PATCH New Leon Anavi 1 participant 2 messages Aug 4

lore
Share & tools
lore

Leon Anavi

author
#0 lore raw

PATCH 1/2 python3-pytest-timeout: Add runtime dependencies

Add a DESCRIPTION and extend the runtime dependencies of the recipe for pytest-timeout, a pytest plugin to abort hanging tests.

---
 .../python/python3-pytest-timeout_2.4.0.bb        | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
meta-python/recipes-devtools/python/python3-pytest-timeout_2.4.0.bb +10 -5
index 6d7901f5e7..c30e7a1ddd 100644
@@ -1,13 +1,18 @@
-SUMMARY = "py.test plugin to abort hanging tests"
+SUMMARY = "pytest plugin to abort hanging tests"
+DESCRIPTION = "pytest plugin to abort hanging tests"
 HOMEPAGE = "https://github.com/pytest-dev/pytest-timeout/"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=d8048cd156eda3df2e7f111b0ae9ceff"
 
 SRC_URI[sha256sum] = "7e68e90b01f9eff71332b25001f85c75495fc4e3a836701876183c4bcfd0540a"
 
-inherit pypi python_setuptools_build_meta
-
-RDEPENDS:${PN} = "python3-pytest"
-
 PYPI_PACKAGE = "pytest_timeout"
 UPSTREAM_CHECK_PYPI_PACKAGE = "${PYPI_PACKAGE}"
+
+inherit pypi python_setuptools_build_meta
+
+RDEPENDS:${PN} += "\
+    python3-core \
+    python3-pytest \
+    python3-pexpect \
+"
Signature · 1 line
2.47.3
author
#1 lore raw

PATCH 2/2 python3-pika: Enable tests

Inherit ptest-python-pytest and include tests for Pika. Run the tests that don't require the docker container with RabbitMQ. The PyPI package omits some files for testing like tests/__init__.py use the GitHub source for SRC_URI instead.

---
 .../python/python3-pika/run-ptest             |  3 ++
 .../python/python3-pika_1.4.2.bb              | 29 +++++++++++++++----
 2 files changed, 26 insertions(+), 6 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-pika/run-ptest
meta-python/recipes-devtools/python/python3-pika/run-ptest new file +3 -0
new file mode 100644
index 0000000000..786883c877
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+pytest --automake tests/unit/ tests/misc/ tests/stubs/
meta-python/recipes-devtools/python/python3-pika_1.4.2.bb +23 -6
index beb32240c5..b64a4a508a 100644
@@ -10,17 +10,34 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=678ec81495ba50edf81e84e4f1aa69f3"
 
 SRC_URI[sha256sum] = "48d1f50297e76be4fc798fd5232d4d532d7a4758e51f7c0ae6c4004b9808a26b"
 
-inherit pypi python_setuptools_build_meta
+# The PyPI package omits some files for testing like tests/__init__.py
+# so use the GitHub source instead.
+SRCREV = "3c9b50d4167e436c73cecae8127e3c5b266b2fce"
+SRC_URI = "\
+    git://github.com/pika/pika;branch=1.4.x;protocol=https \
+    file://run-ptest \
+"
+
+inherit python_setuptools_build_meta ptest-python-pytest
 
 PYPI_PACKAGE = "pika"
 
 DEPENDS += " \
-	python3-setuptools-scm-native \
-	python3-toml-native \
+    python3-setuptools-scm-native \
+    python3-toml-native \
 "
 
 RDEPENDS:${PN} += " \
-	python3-logging \
-	python3-tornado \
-	python3-twisted \
+    python3-logging \
+    python3-tornado \
+    python3-twisted \
+    python3-gevent \
 "
+
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest-timeout \
+"
+
+do_install_ptest:append() {
+    install -m 0644 ${S}/pyproject.toml ${D}${PTEST_PATH}/
+}
Signature · 1 line
2.47.3