Skip to content

Commit b3aedc3

Browse files
committed
[VERSION] Update flagtree whl version on triton_v3.3.x
1 parent b1233c8 commit b3aedc3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

python/setup.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,19 @@ def get_git_commit_hash(length=8):
777777
return ""
778778

779779

780+
def get_flagtree_version():
781+
import hashlib
782+
PYPI_KEY_MD5 = "ed98ae2a2ba0429b189537c0d3dbef43"
783+
key = os.environ.get("FLAGTREE_PYPI_KEY", "")
784+
flagtree_ver = os.environ.get("FLAGTREE_WHEEL_VERSION", "")
785+
if flagtree_ver:
786+
if hashlib.md5(key.encode()).hexdigest() == PYPI_KEY_MD5:
787+
return flagtree_ver
788+
else:
789+
return flagtree_ver + get_git_commit_hash().replace("+", ".")
790+
return "0.5.0" + get_git_commit_hash()
791+
792+
780793
def get_git_branch():
781794
try:
782795
cmd = ['git', 'rev-parse', '--abbrev-ref', 'HEAD']
@@ -799,7 +812,7 @@ def get_git_version_suffix():
799812

800813
setup(
801814
name=os.environ.get("FLAGTREE_WHEEL_NAME", "flagtree"),
802-
version=os.environ.get("FLAGTREE_WHEEL_VERSION", "") or "0.5.0" + get_git_commit_hash(),
815+
version=get_flagtree_version(),
803816
author="FlagOS",
804817
author_email="contact@flagos.io",
805818
description=

0 commit comments

Comments
 (0)