summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
authorJan Vermaete <jan.vermaete@gmail.com>2025-11-10 18:40:22 +0100
committerKhem Raj <raj.khem@gmail.com>2025-11-10 10:21:42 -0800
commit94d633bbe8a5c913a5a229262ec00c6ce4dfb10c (patch)
tree69f333a1c969d3a18544396d236f4834b3fff0bb /meta-python
parent91a1d13cc471472ba04075338986a74d3f79c709 (diff)
downloadmeta-openembedded-94d633bbe8a5c913a5a229262ec00c6ce4dfb10c.tar.gz
python3-python-dotenv: new recipe (1.2.1)
Moving the recipe from meta-homeassistant to meta-opemembedded. + version bump 1.1.1 -> 1.2.1 + add ptest - exclude 2 tests (oe-specific) - added to PTESTS_FAST_META_PYTHON v2: += for -ptest (Thanks Gyorgy Sarvari) Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/conf/include/ptest-packagelists-meta-python.inc1
-rw-r--r--meta-python/recipes-devtools/python/python3-python-dotenv/0001-test_main.py-skip-two-test-when-running-as-root.patch39
-rw-r--r--meta-python/recipes-devtools/python/python3-python-dotenv_1.2.1.bb22
3 files changed, 62 insertions, 0 deletions
diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc
index f9a477c47c..750051e804 100644
--- a/meta-python/conf/include/ptest-packagelists-meta-python.inc
+++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc
@@ -65,6 +65,7 @@ PTESTS_FAST_META_PYTHON = "\
65 python3-pydantic \ 65 python3-pydantic \
66 python3-pydantic-core \ 66 python3-pydantic-core \
67 python3-pylint \ 67 python3-pylint \
68 python3-python-dotenv \
68 python3-python-multipart \ 69 python3-python-multipart \
69 python3-ptyprocess \ 70 python3-ptyprocess \
70 python3-py-cpuinfo \ 71 python3-py-cpuinfo \
diff --git a/meta-python/recipes-devtools/python/python3-python-dotenv/0001-test_main.py-skip-two-test-when-running-as-root.patch b/meta-python/recipes-devtools/python/python3-python-dotenv/0001-test_main.py-skip-two-test-when-running-as-root.patch
new file mode 100644
index 0000000000..154ab559a4
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-python-dotenv/0001-test_main.py-skip-two-test-when-running-as-root.patch
@@ -0,0 +1,39 @@
1From 68e4f05ece6b20e8a7d914d047185483373db759 Mon Sep 17 00:00:00 2001
2From: Jan Vermaete <jan.vermaete@gmail.com>
3Date: Mon, 10 Nov 2025 18:04:27 +0100
4Subject: [PATCH 1/1] test_main.py: skip two test when running as root
5
6Upstream-Status: Inappropriate [oe-specific]
7
8The patch will only work for Linux and not for Windows.
9And it's not common to run the tests of a Python module as root in the
10not Yocto world.
11
12Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com>
13---
14 tests/test_main.py | 2 ++
15 1 file changed, 2 insertions(+)
16
17diff --git a/tests/test_main.py b/tests/test_main.py
18index 4496111..182bc33 100644
19--- a/tests/test_main.py
20+++ b/tests/test_main.py
21@@ -61,6 +61,7 @@ def test_set_key_encoding(dotenv_path):
22 assert dotenv_path.read_text(encoding=encoding) == "a='é'\n"
23
24
25+@pytest.mark.skipif(os.geteuid() == 0, reason="Skipping becuase user is root")
26 def test_set_key_permission_error(dotenv_path):
27 dotenv_path.chmod(0o000)
28
29@@ -167,6 +168,7 @@ def test_unset_encoding(dotenv_path):
30 assert dotenv_path.read_text(encoding=encoding) == ""
31
32
33+@pytest.mark.skipif(os.geteuid() == 0, reason="Skipping becuase user is root")
34 def test_set_key_unauthorized_file(dotenv_path):
35 dotenv_path.chmod(0o000)
36
37--
382.47.3
39
diff --git a/meta-python/recipes-devtools/python/python3-python-dotenv_1.2.1.bb b/meta-python/recipes-devtools/python/python3-python-dotenv_1.2.1.bb
new file mode 100644
index 0000000000..58784fcf2e
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-python-dotenv_1.2.1.bb
@@ -0,0 +1,22 @@
1SUMMARY = "Read key-value pairs from a .env file and set them as environment variables"
2HOMEPAGE = "https://github.com/theskumar/python-dotenv"
3LICENSE = "BSD-3-Clause"
4LIC_FILES_CHKSUM = "file://LICENSE;md5=e914cdb773ae44a732b392532d88f072"
5RECIPE_MAINTAINER = "Tom Geelen <t.f.g.geelen@gmail.com>"
6
7SRC_URI[sha256sum] = "42667e897e16ab0d66954af0e60a9caa94f0fd4ecf3aaf6d2d260eec1aa36ad6"
8
9SRC_URI += "file://0001-test_main.py-skip-two-test-when-running-as-root.patch"
10
11inherit pypi python_setuptools_build_meta ptest-python-pytest
12
13# Uncomment this line to enable all the optional features.
14#PACKAGECONFIG ?= "cli"
15PACKAGECONFIG[cli] = ",,,python3-click"
16
17PYPI_PACKAGE = "python_dotenv"
18UPSTREAM_CHECK_PYPI_PACKAGE = "${PYPI_PACKAGE}"
19
20RDEPENDS:${PN}-ptest += "\
21 python3-sh \
22"