Skip to contentSkip to conversation

python3-hypothesis: upgrade 6.14.8 -> 6.15.0

PATCH New Tim Orling 1 participant 2 messages Aug 22, 2021

lore
Share & tools
lore

Tim Orling

author
#0 lore raw

PATCH 1/2 python3-hypothesis: upgrade 6.14.8 -> 6.15.0

6.15.0 - 2021-08-22

This release emits a more useful error message when @given() is applied to a coroutine function, i.e. one defined using async def (issue #3054).

This was previously only handled by the generic return_value health check, which doesn’t direct you to use either a custom executor or a library such as pytest-trio or pytest-asyncio to handle it for you.

6.14.9 - 2021-08-20

This patch fixes a regression in Hypothesis 6.14.8, where from_type() failed to resolve types which inherit from multiple parametrised generic types, affecting the returns package (issue #3060).

References:
https://github.com/HypothesisWorks/hypothesis/issues/3054
https://github.com/HypothesisWorks/hypothesis/issues/3060

---
 ...ython3-hypothesis_6.14.8.bb => python3-hypothesis_6.15.0.bb} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-devtools/python/{python3-hypothesis_6.14.8.bb => python3-hypothesis_6.15.0.bb} (85%)
meta/recipes-devtools/python/python3-hypothesis_6.15.0.bb renamed from meta/recipes-devtools/python/python3-hypothesis_6.14.8.bb +1 -1
similarity index 85%
rename from meta/recipes-devtools/python/python3-hypothesis_6.14.8.bb
rename to meta/recipes-devtools/python/python3-hypothesis_6.15.0.bb
index bc29b94a54..9f0b7eaf3d 100644
@@ -7,7 +7,7 @@ PYPI_PACKAGE = "hypothesis"
 
 inherit pypi setuptools3
 
-SRC_URI[sha256sum] = "cb80e06ca44992b08d2889734b740e67c8b41337315bbd6dba2ef43ca816cfe3"
+SRC_URI[sha256sum] = "10699f595eebb9410fd902908aa13aece19be5c437b405092be34f60f69f7999"
 
 RDEPENDS:${PN} += " \
     python3-attrs \
Signature · 1 line
2.30.2
author
#1 lore raw

PATCH 2/2 python3-hypothesis: enable ptest

The upstream "fast" tests (tests/cover and tests/pytest) take over 5 minutes to run and do not run cleanly. They also add dependency on python3-pexpect and python3-ptyprocess (currently in meta-python).

The tests are also not included in the pypi tarball, so it would require use of git fetcher and other invasive changes to the recipe, including dropping the pypi inherit.

Instead, use two test suites from examples/

References:
https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python/tests
https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python/examples

---
 .../distro/include/ptest-packagelists.inc     |   1 +
 .../python/python3-hypothesis/run-ptest       |  10 ++
 .../python3-hypothesis/test_binary_search.py  | 135 ++++++++++++++++++
 .../python/python3-hypothesis/test_rle.py     | 101 +++++++++++++
 .../python/python3-hypothesis_6.15.0.bb       |  18 ++-
 5 files changed, 264 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/python/python3-hypothesis/run-ptest
 create mode 100644 meta/recipes-devtools/python/python3-hypothesis/test_binary_search.py
 create mode 100644 meta/recipes-devtools/python/python3-hypothesis/test_rle.py
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 3872bdc942..e0ae1dd971 100644
@@ -48,6 +48,7 @@ PTESTS_FAST = "\
     pango-ptest \
     parted-ptest \
     python3-atomicwrites-ptest \
+    python3-hypothesis-ptest \
     python3-jinja2-ptest \
     python3-markupsafe-ptest \
     python3-more-itertools-ptest \
meta/recipes-devtools/python/python3-hypothesis/run-ptest new file +10 -0
new file mode 100644
index 0000000000..8d44d7c49a
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Upstream "fast" tests take about 5 minutes and currently do not run cleanly
+# (tests/cover and tests/pytest)
+# https://github.com/HypothesisWorks/hypothesis/tree/master/hypothesis-python/tests
+# https://github.com/HypothesisWorks/hypothesis/blob/master/hypothesis-python/scripts/basic-test.sh#L18
+#
+# Instead we run two test suites imported from examples/
+
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta/recipes-devtools/python/python3-hypothesis/test_binary_search.py new file +135 -0

135 lines not on this page · raw message

meta/recipes-devtools/python/python3-hypothesis/test_rle.py new file +101 -0

101 lines not on this page · raw message

meta/recipes-devtools/python/python3-hypothesis_6.15.0.bb +17 -1
index 9f0b7eaf3d..1ea6bb56e6 100644
@@ -5,7 +5,13 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4ee62c16ebd0f4f99d906f36b7de8c3c"
 
 PYPI_PACKAGE = "hypothesis"
 
-inherit pypi setuptools3
+inherit pypi setuptools3 ptest
+
+SRC_URI += " \
+    file://run-ptest \
+    file://test_binary_search.py \
+    file://test_rle.py \
+    "
 
 SRC_URI[sha256sum] = "10699f595eebb9410fd902908aa13aece19be5c437b405092be34f60f69f7999"
 
@@ -19,4 +25,14 @@ RDEPENDS:${PN} += " \
     python3-unittest \
     "
 
+RDEPENDS:${PN}-ptest += " \
+    ${PYTHON_PN}-pytest \
+    "
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/examples
+    install -m 0755 ${WORKDIR}/test_binary_search.py ${D}${PTEST_PATH}/examples/
+    install -m 0755 ${WORKDIR}/test_rle.py ${D}${PTEST_PATH}/examples/
+}
+
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.30.2