parameterize get_version and add get_release_notes function (#31922)

version
pull/31924/head
Justin Newberry 1 year ago committed by GitHub
parent 4fbc8a3896
commit 018b6d0fae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 11
      system/version.py

@ -16,12 +16,17 @@ training_version: bytes = b"0.2.0"
terms_version: bytes = b"2" terms_version: bytes = b"2"
@cache def get_version(path: str = BASEDIR) -> str:
def get_version() -> str: with open(os.path.join(path, "common", "version.h")) as _versionf:
with open(os.path.join(BASEDIR, "common", "version.h")) as _versionf:
version = _versionf.read().split('"')[1] version = _versionf.read().split('"')[1]
return version 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 @cache
def get_short_version() -> str: def get_short_version() -> str:
return get_version().split('-')[0] return get_version().split('-')[0]

Loading…
Cancel
Save