2015-11-09 11:33:38 +08:00
|
|
|
import os
|
|
|
|
|
2020-07-30 00:54:07 +08:00
|
|
|
def get_version():
|
2019-02-17 14:49:45 +08:00
|
|
|
override = os.getenv("VERSIONEER_OVERRIDE")
|
|
|
|
if override:
|
2020-07-30 00:54:07 +08:00
|
|
|
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
|