artiq/artiq/_version.py

14 lines
425 B
Python
Raw Normal View History

2015-11-09 11:33:38 +08:00
import os
def get_version():
2019-02-17 14:49:45 +08:00
override = os.getenv("VERSIONEER_OVERRIDE")
if override:
return override
srcroot = os.path.join(os.path.dirname(os.path.abspath(__file__)), os.pardir)
with open(os.path.join(srcroot, "MAJOR_VERSION"), "r") as f:
version = f.read().strip()
version += ".unknown"
if os.path.exists(os.path.join(srcroot, "BETA")):
version += ".beta"
return version