parameterize get_version and add get_release_notes function (#31922)

version
old-commit-hash: 018b6d0fae
pull/32199/head
Justin Newberry 1 year ago committed by GitHub
parent a5bc36ea9d
commit 1f218e4169
  1. 11
      system/version.py

@ -16,12 +16,17 @@ training_version: bytes = b"0.2.0"
terms_version: bytes = b"2"
@cache
def get_version() -> str:
with open(os.path.join(BASEDIR, "common", "version.h")) as _versionf:
def get_version(path: str = BASEDIR) -> str:
with open(os.path.join(path, "common", "version.h")) as _versionf:
version = _versionf.read().split('"')[1]
return version
def get_release_notes(path: str = BASEDIR) -> str:
with open(os.path.join(path, "RELEASES.md"), "r") as f:
return f.read().split('\n\n', 1)[0]
@cache
def get_short_version() -> str:
return get_version().split('-')[0]

Loading…
Cancel
Save