aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralperak <alperyasinak1@gmail.com>2024-02-08 15:00:45 +0300
committerKhem Raj <raj.khem@gmail.com>2024-02-09 09:52:15 -0800
commit5a45aa504a37a45fa28daeb26b56c046f0419ade (patch)
treee153920f42146f67b86f723deb54ba3d367b8bef
parentae8d97707663ffaa70dd398c26c3ec74705fa49e (diff)
downloadmeta-openembedded-contrib-5a45aa504a37a45fa28daeb26b56c046f0419ade.tar.gz
python3-strenum: add recipe
StrEnum is a Python enum.Enum that inherits from str to complement enum.IntEnum in the standard library Signed-off-by: alperak <alperyasinak1@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-python/recipes-devtools/python/python3-strenum/0001-patch-versioneer-for-python-3.12-compatibility.patch37
-rw-r--r--meta-python/recipes-devtools/python/python3-strenum_0.4.15.bb14
2 files changed, 51 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-strenum/0001-patch-versioneer-for-python-3.12-compatibility.patch b/meta-python/recipes-devtools/python/python3-strenum/0001-patch-versioneer-for-python-3.12-compatibility.patch
new file mode 100644
index 0000000000..cdf3f1acb7
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-strenum/0001-patch-versioneer-for-python-3.12-compatibility.patch
@@ -0,0 +1,37 @@
+From 3a71c9bc3747201e5bebe0e80b98ac6219209875 Mon Sep 17 00:00:00 2001
+From: alperak <alperyasinak1@gmail.com>
+Date: Thu, 8 Feb 2024 14:09:32 +0300
+Subject: [PATCH] Patch versioneer for Python 3.12 compatibility
+
+AttributeError: 'ConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?
+AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
+
+readfp and SafeConfigParser has been deprecated since Python 3.2 and removed in Python 3.12 (due October 2023). Use read_file and ConfigParser instead.
+
+https://docs.python.org/3/whatsnew/3.12.html#configparser
+
+Upstream-Status: Submitted [https://github.com/irgeek/StrEnum/pull/34]
+Signed-off-by: alperak <alperyasinak1@gmail.com>
+---
+ versioneer.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/versioneer.py b/versioneer.py
+index 64fea1c..3aa5da3 100644
+--- a/versioneer.py
++++ b/versioneer.py
+@@ -339,9 +339,9 @@ def get_config_from_root(root):
+ # configparser.NoOptionError (if it lacks "VCS="). See the docstring at
+ # the top of versioneer.py for instructions on writing your setup.cfg .
+ setup_cfg = os.path.join(root, "setup.cfg")
+- parser = configparser.SafeConfigParser()
++ parser = configparser.ConfigParser()
+ with open(setup_cfg, "r") as f:
+- parser.readfp(f)
++ parser.read_file(f)
+ VCS = parser.get("versioneer", "VCS") # mandatory
+
+ def get(parser, name):
+--
+2.25.1
+
diff --git a/meta-python/recipes-devtools/python/python3-strenum_0.4.15.bb b/meta-python/recipes-devtools/python/python3-strenum_0.4.15.bb
new file mode 100644
index 0000000000..aa85189ee5
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-strenum_0.4.15.bb
@@ -0,0 +1,14 @@
+SUMMARY = "An Enum that inherits from str"
+HOMEPAGE = "https://github.com/irgeek/StrEnum"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ba0eb3de1df70bde0ed48488cfd81269"
+
+SRC_URI += "file://0001-patch-versioneer-for-python-3.12-compatibility.patch"
+
+DEPENDS = "${PYTHON_PN}-pytest-runner-native"
+
+SRC_URI[sha256sum] = "878fb5ab705442070e4dd1929bb5e2249511c0bcf2b0eeacf3bcd80875c82eff"
+
+PYPI_PACKAGE = "StrEnum"
+
+inherit pypi python_setuptools_build_meta