Skip to contentSkip to conversation

python3-pytest-httpserver: Add recipe

PATCH New Leon Anavi 1 participant 2 messages Jul 29

lore
Share & tools
lore

Leon Anavi

author
#0 lore raw

PATCH 1/2 python3-pytest-httpserver: Add recipe

Add recipe for pytest_httpserver, a HTTP server for pytest. Changelog for release 1.1.5:

- Add bake() method for pre-configured request expectations

This work was sponsored by GOVCERT.LU.

---
 .../python/python3-pytest-httpserver_1.1.5.bb | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pytest-httpserver_1.1.5.bb
meta-python/recipes-devtools/python/python3-pytest-httpserver_1.1.5.bb new file +19 -0
new file mode 100644
index 0000000000..4421260005
@@ -0,0 +1,19 @@
+SUMMARY = "HTTP server for pytest to test http clients"
+DESCRIPTION = "HTTP server for pytest to test http clients"
+HOMEPAGE = "https://github.com/csernazs/pytest-httpserver"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7f54416ccc5478427995b27e5ef38e92"
+
+SRC_URI[sha256sum] = "dc3d82e1fe00e491829d8939c549bf4bd9b39a260f87113c619b9d517c2f8ff1"
+
+PYPI_PACKAGE = "pytest_httpserver"
+
+inherit pypi python_poetry_core ptest-python-pytest
+
+RDEPENDS:${PN}-ptest += " \
+        python3-requests \
+"
+
+RDEPENDS:${PN} += " \
+        python3-werkzeug \
+"
Signature · 1 line
2.47.3
author
#1 lore raw

PATCH 2/2 python3-py7zr: Enable tests

- Inherit ptest-python-pytest and include tests for py7zr.

- Switch from PyPI to using the source code from GitHub to download the tests.

- Remove liblzma pre-stripped binaries because they are not neeed and to avoid the already-stripped QA errors.

- Add python3-pytest-httpserver and other runtime dependencies for the tests.

This work was sponsored by GOVCERT.LU.

---
 .../python/python3-py7zr_1.1.3.bb             | 20 ++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
meta-python/recipes-devtools/python/python3-py7zr_1.1.3.bb +17 -3
index 865e314f0a..1cbbe12fe4 100644
@@ -4,13 +4,14 @@ LICENSE = "LGPL-2.1-or-later"
 SECTION = "devel/python"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=4fbd65380cdd255951079008b364516c"
 
-SRC_URI[sha256sum] = "8d51894abb38355bf14881088bb97f01fe4cb5b14ebe22f66d6297668c7e1a74"
+SRC_URI = "git://github.com/miurahr/py7zr.git;branch=master;protocol=https"
+SRCREV = "e278bc05cc937ecd1ee62bc6a058db3a21e66614"
 
 CVE_PRODUCT = "py7zr"
 
-inherit pypi python_setuptools_build_meta
+inherit python_setuptools_build_meta ptest-python-pytest
 
-DEPENDS += " \
+DEPENDS += "\
     python3-setuptools-scm-native \
     python3-toml-native \
     python3-wheel-native \
@@ -29,3 +30,16 @@ RDEPENDS:${PN} += "\
     python3-core \
     python3-threading \
 "
+
+RDEPENDS:${PN}-ptest += "\
+    python3-texttable \
+    python3-requests \
+    python3-pytest-httpserver \
+    python3-psutil \
+"
+
+do_install_ptest:append() {
+    # Remove liblzma pre-stripped binaries because they are not
+    # neeed and to avoid the already-stripped QA errors
+    rm -rf ${D}${PTEST_PATH}/tests/data/lib
+}
Signature · 1 line
2.47.3