16 lines
479 B
Python
16 lines
479 B
Python
import re
|
|
import os
|
|
|
|
def get_version():
|
|
VERSIONFILE = os.path.join(os.path.dirname(os.path.abspath(__file__)),"spintrum/meta.py")
|
|
verstrline = open(VERSIONFILE, "rt").read()
|
|
VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
|
|
mo = re.search(VSRE, verstrline, re.M)
|
|
if mo:
|
|
return str(mo.group(1))
|
|
else:
|
|
raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
|
|
|
|
with open("TEMP_VERSION.txt","w") as f:
|
|
f.write(get_version())
|