Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 1 | From 0d0ffab004306b1379f247016200ade381d1d181 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Wed, 8 Feb 2023 23:03:47 -0800 |
| 4 | Subject: [PATCH] setup.py: Do not poke at git describe to find version |
| 5 | |
| 6 | OE uses git snapshot and git describe --tags will emit a string which is |
| 7 | not PEP440 compliant version scheme. setuptools 67+ is strict about it |
| 8 | and fails to build. Therefore inject a static version.py from OE |
| 9 | environment and use that for version number based on PV |
| 10 | |
| 11 | Upstream-Status: Pending |
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 13 | --- |
| 14 | setup.py | 10 ++-------- |
| 15 | 1 file changed, 2 insertions(+), 8 deletions(-) |
| 16 | |
| 17 | diff --git a/setup.py b/setup.py |
| 18 | index 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 | -- |
| 39 | 2.39.1 |
| 40 | |