Skip to contentSkip to conversation

python3-pint: Upgrade to 0.24.3

PATCH New Khem Raj 1 participant 3 messages Sep 26, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 python3-pint: Upgrade to 0.24.3

- Switch to fetching from pypi
- Use automake format for pytests
- Fix ptests, by adding missing runtime deps

---
 .../python/python3-pint/run-ptest               |  2 +-
 ...n3-pint_0.24.1.bb => python3-pint_0.24.3.bb} | 17 ++++++++++-------
 2 files changed, 11 insertions(+), 8 deletions(-)
 rename meta-python/recipes-devtools/python/{python3-pint_0.24.1.bb => python3-pint_0.24.3.bb} (66%)
meta-python/recipes-devtools/python/python3-pint/run-ptest +1 -1
index 5cec711696..8d2017d39c 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-pytest
+pytest --automake
meta-python/recipes-devtools/python/python3-pint_0.24.3.bb renamed from meta-python/recipes-devtools/python/python3-pint_0.24.1.bb +10 -7
similarity index 66%
rename from meta-python/recipes-devtools/python/python3-pint_0.24.1.bb
rename to meta-python/recipes-devtools/python/python3-pint_0.24.3.bb
index 8959a72ff7..23e9fdb0e2 100644
@@ -6,14 +6,11 @@ SECTION = "devel/python"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=bccf824202692270a1e0829a62e3f47b"
 
-PYPI_PACKAGE := "Pint"
+PYPI_PACKAGE = "pint"
 
-inherit ptest python_setuptools_build_meta
+inherit pypi ptest python_setuptools_build_meta
 
-SRCREV = "4c2caccfc6cdac1f80a9bfa15ebea1ca49836881"
-SRC_URI = "git://github.com/hgrecco/pint;protocol=https;branch=master"
-S = "${WORKDIR}/git"
-#SRC_URI[sha256sum] = "e1509b91606dbc52527c600a4ef74ffac12fff70688aff20e9072409346ec9b4"
+SRC_URI[sha256sum] = "d54771093e8b94c4e0a35ac638c2444ddf3ef685652bab7675ffecfa0c5c5cdf"
 
 DEPENDS += "python3-setuptools-scm-native"
 
@@ -27,12 +24,18 @@ RDEPENDS:${PN} += " \
     python3-setuptools \
     python3-packaging \
 "
-
+# python3-misc for timeit.py 
 RDEPENDS:${PN}-ptest += " \
 	python3-appdirs \
+	python3-attrs \
 	python3-flexcache \
 	python3-flexparser \
+	python3-misc \
 	python3-pytest \
+	python3-pytest-benchmark \
+	python3-pytest-subtests \
+	python3-statistics \
+	python3-unittest-automake-output \
 "
 
 do_install_ptest() {
author
#1 lore raw

PATCH 2/3 python3-pytest-mock: Fix ptests

- Drop the patch to add additional checks to disable failing introspection tests, use plain asserts instead

- Switch to pypi fetcher

- Add missing rdeps needed for ptest runs

Cc Trevor Gamblin <[email protected]>
---
 ...t_mock-skip-args-introspection-tests.patch | 38 -------------------
 .../python/python3-pytest-mock/run-ptest      |  4 +-
 .../python/python3-pytest-mock_3.14.0.bb      | 19 +++++-----
 3 files changed, 11 insertions(+), 50 deletions(-)
 delete mode 100644 meta-python/recipes-devtools/python/python3-pytest-mock/0001-test_pytest_mock-skip-args-introspection-tests.patch
meta-python/recipes-devtools/python/python3-pytest-mock/0001-test_pytest_mock-skip-args-introspection-tests.patch deleted +0 -38
deleted file mode 100644
index f024e79d93..0000000000
@@ -1,38 +0,0 @@
-From e184fb950ad3b52c5c16438d39fe4d516c784e30 Mon Sep 17 00:00:00 2001
-From: Trevor Gamblin <[email protected]>
-Date: Thu, 12 Oct 2023 17:32:40 -0400
-Subject: [PATCH] test_pytest_mock: skip args introspection tests
-
-Disable these two tests for now so that python3-pytest-mock can have
-successful ptest runs.
-
-Upstream-Status: Inappropriate [OE-Specific]
-
-Signed-off-by: Trevor Gamblin <[email protected]>
----
- tests/test_pytest_mock.py | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/tests/test_pytest_mock.py b/tests/test_pytest_mock.py
-index 3d53241..157b6c3 100644
---- a/tests/test_pytest_mock.py
-+++ b/tests/test_pytest_mock.py
-@@ -581,6 +581,7 @@ def test_assert_called_wrapper(mocker: MockerFixture) -> None:
-     stub.assert_called()
- 
- 
[email protected]("Async not correctly detected, skip for now")
- @pytest.mark.usefixtures("needs_assert_rewrite")
- def test_assert_called_args_with_introspection(mocker: MockerFixture) -> None:
-     stub = mocker.stub()
-@@ -597,6 +598,7 @@ def test_assert_called_args_with_introspection(mocker: MockerFixture) -> None:
-         stub.assert_called_once_with(*wrong_args)
- 
- 
[email protected]("Async not correctly detected, skip for now")
- @pytest.mark.usefixtures("needs_assert_rewrite")
- def test_assert_called_kwargs_with_introspection(mocker: MockerFixture) -> None:
-     stub = mocker.stub()
--- 
-2.41.0
-
meta-python/recipes-devtools/python/python3-pytest-mock/run-ptest +2 -2
index 8d2017d39c..51ae892b01 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
-
-pytest --automake
+# see https://github.com/pytest-dev/pytest-mock/issues/102 for reasons to use plain asserts
+pytest --automake --assert=plain
meta-python/recipes-devtools/python/python3-pytest-mock_3.14.0.bb +9 -10
index fe2479c836..b968cf1cd4 100644
@@ -5,28 +5,27 @@ LIC_FILES_CHKSUM = " \
     file://LICENSE;md5=b2ddb1e69238461b7e4ef2a84d874109 \
 "
 
-SRC_URI = " \
-    git://github.com/pytest-dev/pytest-mock;branch=main;protocol=https \
-    file://0001-test_pytest_mock-skip-args-introspection-tests.patch \
+SRC_URI += " \
     file://run-ptest \
 "
-SRCREV = "8733134b6194395e9cd3c745adcc9a9c09b0279e"
+SRC_URI[sha256sum] = "2719255a1efeceadbc056d6bf3df3d1c5015530fb40cf347c0f9afac88410bd0" 
 
-inherit python_setuptools_build_meta ptest
+inherit pypi python_setuptools_build_meta ptest
+
+PYPI_PACKAGE = "pytest-mock"
 
 DEPENDS += "python3-setuptools-scm-native"
 
-RDEPENDS:${PN} += " \
-    python3-asyncio \
+RDEPENDS:${PN}-ptest += " \
+    python3-misc \
     python3-mock \
     python3-pytest \
     python3-pytest-asyncio \
-    python3-unittest \
+    python3-threading \
+    python3-tox \
     python3-unittest-automake-output \
 "
 
-S = "${WORKDIR}/git"
-
 do_install_ptest() {
     install -d ${D}${PTEST_PATH}/tests
     cp -rf ${S}/tests ${D}${PTEST_PATH}/
author
#2 lore raw

PATCH 3/3 python3-sqlparse: Add missing rdep on mypy module for ptests

In reply to Khem Raj

This is needed for fixing

Failed ptests:
{'python3-sqlparse': ['tests/test_cli.py:test_encoding_stdout[encoding_gbk.sql-gbk]',

                      'tests/test_cli.py:test_encoding_output_file[encoding_gbk.sql-gbk]',
                      'tests/test_cli.py:test_encoding_stdin[encoding_gbk.sql-gbk]']}
---
 meta-python/recipes-devtools/python/python3-sqlparse_0.5.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta-python/recipes-devtools/python/python3-sqlparse_0.5.1.bb +1 -0
index 62de2327cb..daf67607f7 100644
@@ -16,6 +16,7 @@ export HOST_SYS
 inherit pypi ptest python_hatchling
 
 RDEPENDS:${PN}-ptest += "\
+    python3-mypy \
     python3-pytest \
     python3-unittest-automake-output \
     python3-unixadmin \