diff --git a/setup.py b/setup.py index 7ce84be3..a84a844d 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,13 @@ import os from setuptools import setup -from smop.version import __version__ as __VERSION__ +try: + __VERSION__ = os.popen("git describe --tags").read().strip() +except OSError as e: + __VERSION__ = "" + +open("version.py","w").write("smop/__version__='%s'" % __VERSION__) +#from smop.version import __version__ as __VERSION__ setup( author = 'Victor Leikehman', diff --git a/smop/main.py b/smop/main.py index 298ebd3d..c0ba35f8 100644 --- a/smop/main.py +++ b/smop/main.py @@ -22,6 +22,7 @@ def print_header(fp): if options.no_header: return + print("# Running Python %s" % sys.version, file=fp) print("# Generated with SMOP ", __version__, file=fp) print("from libsmop import *", file=fp) print("#", options.filename, file=fp) diff --git a/smop/version.py b/smop/version.py deleted file mode 100644 index 2ea2309f..00000000 --- a/smop/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__='0.39'