summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-extended/python-cson/python3-cson/0001-setup.py-Do-not-poke-at-git-describe-to-find-version.patch40
-rw-r--r--meta-python/recipes-extended/python-cson/python3-cson_git.bb10
2 files changed, 48 insertions, 2 deletions
diff --git a/meta-python/recipes-extended/python-cson/python3-cson/0001-setup.py-Do-not-poke-at-git-describe-to-find-version.patch b/meta-python/recipes-extended/python-cson/python3-cson/0001-setup.py-Do-not-poke-at-git-describe-to-find-version.patch
new file mode 100644
index 0000000000..dc3f8657ec
--- /dev/null
+++ b/meta-python/recipes-extended/python-cson/python3-cson/0001-setup.py-Do-not-poke-at-git-describe-to-find-version.patch
@@ -0,0 +1,40 @@
1From 0d0ffab004306b1379f247016200ade381d1d181 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 8 Feb 2023 23:03:47 -0800
4Subject: [PATCH] setup.py: Do not poke at git describe to find version
5
6OE uses git snapshot and git describe --tags will emit a string which is
7not PEP440 compliant version scheme. setuptools 67+ is strict about it
8and fails to build. Therefore inject a static version.py from OE
9environment and use that for version number based on PV
10
11Upstream-Status: Pending
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 setup.py | 10 ++--------
15 1 file changed, 2 insertions(+), 8 deletions(-)
16
17diff --git a/setup.py b/setup.py
18index a77138f..df675cd 100644
19--- a/setup.py
20+++ b/setup.py
21@@ -28,14 +28,8 @@ def main():
22 # Also, when git is not available (PyPi package), use stored version.py.
23 version_py = os.path.join(os.path.dirname(__file__), 'version.py')
24
25- try:
26- if sys.version_info < (2, 7) or (3,) <= sys.version_info < (3, 2):
27- version_git = subprocess.Popen(['ls', '-l'], stdout=subprocess.PIPE).communicate()[0]
28- else:
29- version_git = subprocess.check_output(["git", "describe", "--tags"]).rstrip()
30- except:
31- with open(version_py, 'r') as fh:
32- version_git = open(version_py).read().strip().split('=')[-1].replace('"','')
33+ with open(version_py, 'r') as fh:
34+ version_git = open(version_py).read().strip().split('=')[-1].replace('"','')
35
36 version_msg = "# Do not edit this file, pipeline versioning is governed by git tags"
37 with open(version_py, 'w') as fh:
38--
392.39.1
40
diff --git a/meta-python/recipes-extended/python-cson/python3-cson_git.bb b/meta-python/recipes-extended/python-cson/python3-cson_git.bb
index c4fcc61ec0..f9b4b64a50 100644
--- a/meta-python/recipes-extended/python-cson/python3-cson_git.bb
+++ b/meta-python/recipes-extended/python-cson/python3-cson_git.bb
@@ -7,8 +7,10 @@ LICENSE = "MIT"
7SECTION = "devel/python" 7SECTION = "devel/python"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=7709d2635e63ab96973055a23c2a4cac" 8LIC_FILES_CHKSUM = "file://LICENSE;md5=7709d2635e63ab96973055a23c2a4cac"
9 9
10SRCREV = "f3f2898c44bb16b951d3e9f2fbf6d1c4158edda2" 10PV = "1.0.9+1.0.10"
11SRC_URI = "git://github.com/gt3389b/python-cson.git;branch=master;protocol=https" 11SRCREV = "69090778bccc5ed124342ba288597fbb2bfa9f39"
12SRC_URI = "git://github.com/gt3389b/python-cson.git;branch=master;protocol=https \
13 file://0001-setup.py-Do-not-poke-at-git-describe-to-find-version.patch"
12 14
13S = "${WORKDIR}/git" 15S = "${WORKDIR}/git"
14 16
@@ -19,5 +21,9 @@ inherit setuptools3
19 21
20PIP_INSTALL_PACKAGE = "python_cson" 22PIP_INSTALL_PACKAGE = "python_cson"
21 23
24do_configure:prepend() {
25 echo "__version__=${PV}" > ${S}/version.py
26}
27
22BBCLASSEXTEND = "native" 28BBCLASSEXTEND = "native"
23 29