Skip to content

Commit

Permalink
Automate the version number in setup.py and info.py (#684)
Browse files Browse the repository at this point in the history
Co-authored-by: haasad <[email protected]>
  • Loading branch information
haasad and haasad authored Nov 9, 2021
1 parent 2f125da commit 2257018
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 6 additions & 3 deletions activity_browser/info.py
Original file line number Diff line number Diff line change
@@ -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"
7 changes: 6 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2257018

Please sign in to comment.