diff --git a/activity_browser/info.py b/activity_browser/info.py index 8c8388e18..e8aa9a416 100644 --- a/activity_browser/info.py +++ b/activity_browser/info.py @@ -1,3 +1,6 @@ -# -*- coding: utf-8 -*- -__version__ = "2.6.3" -__version_info__ = (2, 6, 3) +from importlib.metadata import version, PackageNotFoundError + +try: + __version__ = version(__package__) +except PackageNotFoundError: + __version__ = "0.0.0" diff --git a/setup.py b/setup.py index bf9bed815..2ec918454 100644 --- a/setup.py +++ b/setup.py @@ -17,9 +17,14 @@ pkg = pkg.replace(os.path.altsep, '.') packages.append(pkg) +if 'VERSION' in os.environ: + version = os.environ['VERSION'] +else: + version = os.environ.get('GIT_DESCRIBE_TAG', '0.0.0') + setup( name='activity-browser', - version="2.6.3", + version=version, packages=packages, include_package_data=True, author="Bernhard Steubing",