From d51f31e784279e27588d306ddfb28b533dfba8c5 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Mon, 17 Apr 2023 08:06:47 +0200 Subject: [PATCH] setup.py: adjust path to pmb.__version__ setup.py is on its way out, but it isn't replaced just yet. Adjust the code that finds the version. I'm pushing this directly to master as this fix is trivial and unbreaks packaging current master of pmbootstrap. Fix for (from pmbootstrap AUR package): $ pip install build wheel $ python -m build --wheel --no-isolation File "/usr/lib/python3.10/ast.py", line 50, in parse return compile(source, filename, mode, flags, File "", line 1 {"edge": "2.12.11-r0", ^ SyntaxError: '{' was never closed Fixes: 6352ab9c ("Move version to pmb.__version__") Fixes: pmbootstrap#2226 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6abb891c..74e94e86 100755 --- a/setup.py +++ b/setup.py @@ -26,9 +26,9 @@ class PyTest(TestCommand): here = path.abspath(path.dirname(__file__)) -_version_re = re.compile(r'version\s+=\s+(.*)') +_version_re = re.compile(r'__version__\s+=\s+(.*)') -with open(path.join(here, 'pmb/config/__init__.py'), 'rb') as f: +with open(path.join(here, 'pmb/__init__.py'), 'rb') as f: version = str(ast.literal_eval(_version_re.search( f.read().decode('utf-8')).group(1)))