diff mbox series

[meta-python,v2,v2,4/6] python3-time-machine: add at v3.2.0

Message ID 32d30a45ae8eb70f7cd87aaf0bd34cd66a405cc2.1770145884.git.tim.orling@konsulko.com
State New
Headers show
Series [meta-python,v2,v2,1/6] python3-orjson: upgrade 3.10.17 -> 3.11.6 | expand

Commit Message

Tim Orling Feb. 3, 2026, 7:13 p.m. UTC
From: Tim Orling <tim.orling@konsulko.com>

Travel through time in your tests.

https://time-machine.readthedocs.io/en/latest/

Dependency for python3-pendulum ptests.
Based on the recipe in meta-homeassistant.
Enable ptests.
Use git fetcher so that we have tests/ for ptest.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../ptest-packagelists-meta-python.inc        |  1 +
 .../python/python3-time-machine_3.2.0.bb      | 28 +++++++++++++++++++
 2 files changed, 29 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-time-machine_3.2.0.bb
diff mbox series

Patch

diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index bece6304e8..7f4c3cc48f 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -105,6 +105,7 @@  PTESTS_FAST_META_PYTHON = "\
     python3-starlette \
     python3-tblib \
     python3-tenacity \
+    python3-time-machine \
     python3-tokenize-rt \
     python3-tomli-w \
     python3-tomlkit \
diff --git a/meta-python/recipes-devtools/python/python3-time-machine_3.2.0.bb b/meta-python/recipes-devtools/python/python3-time-machine_3.2.0.bb
new file mode 100644
index 0000000000..8e2fa51bb4
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-time-machine_3.2.0.bb
@@ -0,0 +1,28 @@ 
+SUMMARY = "Travel through time in your tests."
+HOMEPAGE = "https://github.com/adamchainz/time-machine"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fb9b93a440d3ef2fb6eeebfa59384c53"
+
+SRCREV = "1b7ac45defb26c72076dc202aba46967c8c28fa9"
+PYPI_SRC_URI = "git://github.com/adamchainz/time-machine;protocol=https;branch=main;tag=${PV};destsuffix=time_machine-${PV}"
+
+inherit pypi python_setuptools_build_meta ptest-python-pytest
+
+PYPI_PACKAGE = "time_machine"
+UPSTREAM_CHECK_PYPI_PACKAGE = "${PYPI_PACKAGE}"
+
+RDEPENDS:${PN} += "\
+    python3-tzdata \
+    python3-unittest \
+    python3-zoneinfo \
+    "
+do_install_ptest:append() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+RDEPENDS:${PN}-ptest += "\
+    python3-dateutil \
+    python3-freezegun \
+    python3-tokenize-rt \
+"