python-cffi: read version from notmuch version file
authorFloris Bruynooghe <flub@devork.be>
Fri, 19 Jun 2020 09:46:28 +0000 (11:46 +0200)
committerDavid Bremner <david@tethera.net>
Fri, 19 Jun 2020 10:01:13 +0000 (07:01 -0300)
This keeps it in sync with the main notmuch version which is less
confusing to users.

bindings/python-cffi/setup.py

index 37918e3d2cdb3b7bcf0a3e3db860bfab5bd1b0db..1effcfc6feec93a7528d95819bc445f66c42a9b6 100644 (file)
@@ -1,9 +1,17 @@
+import pathlib
+
 import setuptools
 
 
+THIS_FILE = pathlib.Path(__file__).absolute()
+PROJECT_ROOT = THIS_FILE.parent.parent.parent
+with open(PROJECT_ROOT.joinpath('version')) as fp:
+    VERSION = fp.read().strip()
+
+
 setuptools.setup(
     name='notmuch2',
-    version='0.1',
+    version=VERSION,
     description='Pythonic bindings for the notmuch mail database using CFFI',
     author='Floris Bruynooghe',
     author_email='flub@devork.be',